/* News AJAX Page Styles */

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Search and Filter Section */
.search-filter-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.search-input-container {
    position: relative;
}

.search-input-container input:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
    border-color: #ff6b00;
}

.search-input-container .search-icon {
    color: #6c757d;
    transition: color 0.2s ease;
}

.search-input-container input:focus + .search-icon {
    color: #ff6b00;
}

.clear-search-btn {
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    color: #dc3545 !important;
    transform: scale(1.1);
}

/* Category Tabs */
.category-tabs-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 0, 0.1);
}

.category-tab {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.category-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.15);
}

.category-tab.active {
    background: linear-gradient(135deg, #ff6b00 0%, #ff8533 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
    border-color: #ff6b00;
}

.category-tab.active::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #ff6b00;
}

/* Loading States */
.loading-overlay {
    position: relative;
}

.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* News List Items */
.news-item {
    transition: all 0.3s ease;
    border: 1px solid transparent;
    border-radius: 12px;
    overflow: hidden;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 107, 0, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
}

.news-item .news-thumbnail {
    transition: transform 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.news-item:hover .news-thumbnail img {
    transform: scale(1.05);
}

.news-item .news-title {
    transition: color 0.2s ease;
}

.news-item:hover .news-title {
    color: #ff6b00;
}

.news-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

.news-meta .separator {
    color: #dee2e6;
    margin: 0 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #dee2e6;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 4rem 2rem;
}

.error-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #dc3545;
}

.error-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #dc3545;
    margin-bottom: 0.5rem;
}

.error-state-description {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
}

.pagination-btn {
    transition: all 0.2s ease;
    border-radius: 8px;
    font-weight: 500;
}

.pagination-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #ff6b00;
    color: white;
    border-color: #ff6b00;
}

.pagination-btn.active {
    background-color: #ff6b00;
    color: white;
    border-color: #ff6b00;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-filter-section {
        padding: 1rem;
    }
    
    .search-filter-section .flex-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .category-tabs-container {
        padding: 0.5rem;
    }
    
    .category-tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .news-item {
        margin-bottom: 1rem;
    }
    
    .news-item .flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .news-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .pagination-container {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .category-tabs-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-tabs-container .flex {
        flex-wrap: nowrap;
        min-width: max-content;
    }
    
    .category-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* Smooth transitions for content updates */
.news-content-transition {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.news-content-transition.loading {
    opacity: 0.6;
    transform: translateY(10px);
}

/* Featured news section transitions */
.featured-news-section {
    transition: all 0.3s ease;
}

.featured-news-section.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* Sort dropdown styling */
.sort-select {
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.sort-select:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
    border-color: #ff6b00;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.category-tab:focus,
.pagination-btn:focus,
.search-input:focus {
    outline: 2px solid #ff6b00;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .category-tab.active {
        background: #000;
        color: #fff;
        border-color: #000;
    }
    
    .pagination-btn:hover {
        background: #000;
        color: #fff;
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .category-tab,
    .news-item,
    .pagination-btn,
    .loading-spinner {
        transition: none;
        animation: none;
    }
}