/**
 * Content Filters Styling
 * Unified styles for filter controls and states
 */

/* Filter Container */
.filters-container {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

/* Search Filter */
.search-filter {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #5DA7E7;
    box-shadow: 0 0 0 3px rgba(93, 167, 231, 0.1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
}

.search-btn:hover {
    color: #5DA7E7;
}

/* Topic/Category Filter */
.topic-filter,
.duration-filter,
.reading-time-filter {
    min-width: 180px;
}

.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.filter-select:focus {
    outline: none;
    border-color: #5DA7E7;
    box-shadow: 0 0 0 3px rgba(93, 167, 231, 0.1);
}

.filter-select:hover {
    border-color: #5DA7E7;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #5DA7E7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

.loading-spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: #6b7280;
    font-size: 16px;
    margin: 0;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    background: #f9fafb;
    border-radius: 16px;
    border: 2px dashed #d1d5db;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.empty-state svg {
    color: #d1d5db;
    margin-bottom: 20px;
    font-size: 64px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 10px 0;
}

.empty-state p {
    color: #6b7280;
    font-size: 15px;
    margin: 0 0 20px 0;
    max-width: 400px;
}

.btn-clear-filters {
    background: #5DA7E7;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-filters:hover {
    background: #4a8bc2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(93, 167, 231, 0.3);
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.error-state svg {
    color: #ef4444;
    margin-bottom: 20px;
}

.error-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 10px 0;
}

.error-state p {
    color: #6b7280;
    font-size: 15px;
    margin: 0 0 20px 0;
    max-width: 400px;
}

.btn-retry {
    background: #5DA7E7;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-retry:hover {
    background: #4a8bc2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(93, 167, 231, 0.3);
}

/* Load More Button */
#load-more-events,
#load-more-videos,
#load-more-articles {
    display: block;
    margin: 40px auto 0;
    padding: 14px 32px;
    background: #5DA7E7;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#load-more-events:hover:not(:disabled),
#load-more-videos:hover:not(:disabled),
#load-more-articles:hover:not(:disabled) {
    background: #4a8bc2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(93, 167, 231, 0.3);
}

#load-more-events:disabled,
#load-more-videos:disabled,
#load-more-articles:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.view-toggle-grid,
.view-toggle-list {
    padding: 10px 14px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.view-toggle-grid:hover,
.view-toggle-list:hover {
    border-color: #5DA7E7;
    color: #5DA7E7;
}

.view-toggle-grid.active,
.view-toggle-list.active {
    background: #5DA7E7;
    border-color: #5DA7E7;
    color: white;
}

.view-toggle-grid svg,
.view-toggle-list svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-filter,
    .topic-filter,
    .duration-filter,
    .reading-time-filter {
        width: 100%;
        min-width: 100%;
    }
    
    .view-toggle {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .search-input,
    .filter-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .search-input {
        padding-right: 40px;
    }
    
    .filter-select {
        padding-right: 35px;
        background-position: right 12px center;
    }
    
    .loading-state,
    .empty-state,
    .error-state {
        padding: 40px 15px;
    }
    
    .empty-state h3,
    .error-state h3 {
        font-size: 18px;
    }
    
    .empty-state p,
    .error-state p {
        font-size: 14px;
    }
}
