/* B2B URL Filter Styles */
.b2b-url-filter {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.b2b-url-filter h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.b2b-filter-btn {
    background: #fff;
    border: 2px solid #007cba;
    color: #007cba;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-width: 120px;
    text-align: center;
}

.b2b-filter-btn:hover {
    background: #007cba;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.b2b-filter-btn.active {
    background: #007cba;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.4);
}

.b2b-filter-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.2);
}

/* Search Input */
#b2b-search-input {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

#b2b-search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Results Container */
#b2b-filter-results {
    min-height: 100px;
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #e1e1e1;
}

/* Post Items */
.b2b-post-item {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.b2b-post-item:last-child {
    border-bottom: none;
}

.b2b-post-item:hover {
    background: #f8f9fa;
    padding-left: 10px;
    margin-left: -10px;
    margin-right: -10px;
    border-radius: 4px;
}

.b2b-post-item h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    line-height: 1.4;
}

.b2b-post-item h4 a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.3s ease;
}

.b2b-post-item h4 a:hover {
    color: #005a87;
    text-decoration: underline;
}

.b2b-post-item p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Loading State */
.b2b-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    position: relative;
}

.b2b-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.b2b-error {
    text-align: center;
    padding: 20px;
    color: #d63638;
    background: #fef7f7;
    border: 1px solid #f1c2c2;
    border-radius: 4px;
    font-weight: 500;
}

/* Empty State */
.b2b-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .b2b-url-filter {
        padding: 15px;
        margin: 15px 0;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
    
    .b2b-filter-btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .b2b-url-filter h3 {
        font-size: 16px;
    }
    
    #b2b-filter-results {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .b2b-url-filter {
        padding: 10px;
        margin: 10px 0;
    }
    
    .b2b-filter-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    #b2b-search-input {
        padding: 10px;
        font-size: 13px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .b2b-url-filter {
        background: #2c2c2c;
        border-color: #444;
        color: #fff;
    }
    
    .b2b-url-filter h3 {
        color: #fff;
    }
    
    .b2b-filter-btn {
        background: #444;
        border-color: #007cba;
        color: #007cba;
    }
    
    .b2b-filter-btn:hover,
    .b2b-filter-btn.active {
        background: #007cba;
        color: #fff;
    }
    
    #b2b-search-input {
        background: #444;
        border-color: #666;
        color: #fff;
    }
    
    #b2b-search-input::placeholder {
        color: #aaa;
    }
    
    #b2b-filter-results {
        background: #333;
        border-color: #444;
        color: #fff;
    }
    
    .b2b-post-item {
        border-bottom-color: #444;
    }
    
    .b2b-post-item:hover {
        background: #3a3a3a;
    }
    
    .b2b-post-item h4 a {
        color: #4fc3f7;
    }
    
    .b2b-post-item h4 a:hover {
        color: #29b6f6;
    }
    
    .b2b-post-item p {
        color: #ccc;
    }
    
    .b2b-error {
        background: #4a2c2c;
        border-color: #6b4444;
        color: #ff6b6b;
    }
}

/* Accessibility Improvements */
.b2b-filter-btn:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

#b2b-search-input:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Animation for filter transitions */
.b2b-post-item {
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badge styles for B2B types */
.b2b-type-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 12px;
    margin-left: 8px;
    vertical-align: middle;
}

.b2b-type-badge.-b2b {
    background: #e3f2fd;
    color: #1976d2;
}

.b2b-type-badge.b2b-2 {
    background: #f3e5f5;
    color: #7b1fa2;
}

.b2b-type-badge.b2b3 {
    background: #e8f5e8;
    color: #388e3c;
}

/* Print styles */
@media print {
    .b2b-url-filter {
        background: none;
        border: 1px solid #000;
    }
    
    .filter-buttons {
        display: none;
    }
    
    #b2b-search-input {
        display: none;
    }
    
    .b2b-loading,
    .b2b-error {
        display: none;
    }
}