/* ========================================= */
/*               BASE STYLES                 */
/* ========================================= */

.news-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================= */
/*              SECTION HEADERS              */
/* ========================================= */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-icon {
    font-size: 2.2rem;
}

.section-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.last-updated {
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

/* ========================================= */
/*             FEATURED NEWS                 */
/* ========================================= */

.featured-news-section {
    margin-bottom: 4rem;
}

.featured-news-container {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.featured-news-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.featured-article {
    display: grid;
    grid-template-columns: 500px 1fr;
    min-height: 400px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.featured-image {
    position: relative;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-article:hover .featured-image img {
    transform: scale(1.05);
}

.featured-category-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.featured-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    position: relative;
}

.featured-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
}

.featured-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.featured-excerpt {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.featured-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-read-time {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.featured-author {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.read-featured-btn {
    background: linear-gradient(135deg, var(--accent-primary), #ffb300);
    color: var(--bg-primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    align-self: flex-start;
}

.read-featured-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

/* ========================================= */
/*           CATEGORY TABS & SEARCH          */
/* ========================================= */

.news-categories-section {
    margin-bottom: 2rem;
}

.category-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    gap: 1rem;
    flex-wrap: wrap;
}

.category-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.category-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.category-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* News Search */
.news-search-container {
    flex-shrink: 0;
    min-width: 280px;
}

.news-search-group {
    position: relative;
    display: flex;
    align-items: center;
}

.news-search-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
}

.news-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
    background: var(--bg-primary);
}

.news-search-input::placeholder {
    color: var(--text-muted);
}

.news-search-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-search-clear:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Search Results */
.search-results-info {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
    font-weight: 600;
    display: none;
}

.search-results-info.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ========================================= */
/*               LATEST NEWS                 */
/* ========================================= */

.latest-news-section {
    margin-bottom: 3rem;
}

/* News Controls */
.news-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.refresh-news-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-news-btn:hover {
    background: #ffb300;
    transform: translateY(-2px);
}

.view-options {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.view-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.view-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Grid View */
.latest-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.news-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-primary);
}

.news-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.1);
}

/* Category Badges */
.category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.update {
    background: #ff6b35;
    color: #1a1a1a;
}

.category-badge.patch {
    background: #ffaa00;
    color: #1a1a1a;
}

.category-badge.event {
    background: #a78bfa;
    color: #ffffff;
}

.category-badge.community {
    background: #4ecdc4;
    color: #1a1a1a;
}

.category-badge.announcement {
    background: #0066cc;
    color: #ffffff;
}

/* Card Content */
.news-card-content {
    padding: 1.5rem;
}

.news-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-excerpt {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.news-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-read-time {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.read-more-btn {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.read-more-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

/* List View */
.latest-news-list {
    display: grid;
    gap: 1.5rem;
}

.news-list-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 1.5rem;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

.news-list-image {
    width: 150px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

.news-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-list-content {
    flex: 1;
}

.news-list-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.news-list-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

/* ========================================= */
/*           LOADING & ERROR STATES         */
/* ========================================= */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.error-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.error-message h3 {
    color: var(--accent-danger);
    margin-bottom: 1rem;
}

.retry-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #ffb300;
    transform: translateY(-2px);
}

.no-news {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* ========================================= */
/*               ANIMATIONS                 */
/* ========================================= */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

/* ========================================= */
/*             RESPONSIVE DESIGN            */
/* ========================================= */

@media (max-width: 1200px) {
    .featured-article {
        grid-template-columns: 400px 1fr;
    }
    
    .latest-news-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .news-page {
        padding: 0 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .featured-article {
        grid-template-columns: 1fr;
    }
    
    .featured-content {
        padding: 2rem;
    }
    
    .featured-title {
        font-size: 1.8rem;
    }
    
    .latest-news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-list-item {
        grid-template-columns: 100px 1fr;
        gap: 1rem;
    }
    
    .news-list-meta {
        grid-column: 1 / -1;
        text-align: left;
        flex-direction: row;
        justify-content: space-between;
        margin-top: 1rem;
    }
    
    .news-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    /* Category Tabs */
    .category-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .category-buttons {
        justify-content: center;
    }
    
    .news-search-container {
        min-width: auto;
        width: 100%;
    }
    
    .category-tab {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .featured-content {
        padding: 1.5rem;
    }
    
    .featured-title {
        font-size: 1.5rem;
    }
    
    .news-card-content {
        padding: 1rem;
    }
    
    .news-list-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .news-list-image {
        width: 100%;
        height: 150px;
        justify-self: center;
    }
    
    .category-buttons {
        flex-direction: column;
    }
    
    .category-tab {
        text-align: center;
        width: 100%;
    }
}