/* News Section Styles */
.news-section {
    padding: 4rem 1rem;
    background: transparent;
    /* Changed from color to handle transparent container overlap if needed, but keeping section generic */
    /* Background is handled by body or section parent usually, but here we want the container to be glass */
}

.news-container {
    max-width: 1440px;
    /* Standardized width */
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.news-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.news-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 800;
}

.news-header p {
    font-size: 1rem;
    color: #444;
    max-width: 700px;
    margin: 0 auto;
}

/* Search Bar */
.search-wrapper {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 100;
}

#newsSearch {
    width: 100%;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
}

#newsSearch:focus {
    outline: none;
    border-color: #FBB03B;
    box-shadow: 0 0 0 3px rgba(251, 176, 59, 0.2);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    /* Controlled by JS */
}

.search-results[hidden] {
    display: none;
}

.search-results:not([hidden]) {
    display: block;
}

.search-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

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

.search-item:hover {
    background: #f9f9f9;
}

.search-item h4 {
    margin: 0 0 4px;
    font-size: 0.9rem;
    color: #2c3e50;
}

.search-item span {
    font-size: 0.75rem;
    color: #888;
}

/* Controls: Year Tabs */
.year-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.year-tab {
    background: white;
    border: 1px solid #ddd;
    padding: 0.4rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    color: #555;
}

.year-tab:hover {
    border-color: #FBB03B;
    color: #333;
}

.year-tab.active {
    background-color: #FBB03B;
    border-color: #FBB03B;
    color: #fff;
    box-shadow: 0 2px 8px rgba(251, 176, 59, 0.4);
}

/* Category Select */
.category-filters {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.category-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.8rem 2.5rem 0.8rem 1.5rem;
    border-radius: 50px;
    border: 1px solid #ddd;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    color: #444;
    background-color: white;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FBB03B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    cursor: pointer;
    min-width: 280px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.category-select:hover,
.category-select:focus {
    border-color: #FBB03B;
    box-shadow: 0 4px 15px rgba(251, 176, 59, 0.2);
    outline: none;
}

/* Stats Row */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    border-radius: 12px;
}

.stat-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    min-width: 100px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #2c3e50;
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 Columns requested */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* News Card */
.news-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 3px solid transparent;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    border-top-color: #FBB03B;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.7rem;
    /* Smaller text */
    color: #888;
}

.news-cat {
    background: #eef2f5;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    color: #2c3e50;
    font-weight: 600;
}

.news-title {
    font-size: 0.95rem;
    /* Smaller text */
    font-weight: 700;
    margin-bottom: 0.8rem;
    line-height: 1.35;
    color: #2c3e50;
    flex-grow: 1;
}

.news-content {
    margin-top: auto;
    border-top: 1px solid #eee;
    padding-top: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-source {
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
    margin: 0;
}

.news-link {
    text-decoration: none;
    color: #FBB03B;
    font-weight: bold;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.news-link:hover {
    color: #d9901c;
}

/* Pagination */
.news-pagination {
    text-align: center;
}

.load-more-btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 0.7rem 2rem;
    font-size: 0.9rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.3s;
}

.load-more-btn:hover {
    background: #34495e;
}

/* Utility */
.loading,
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #777;
    font-style: italic;
}

/* Responsive */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .news-container {
        padding: 1rem;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .news-header h2 {
        font-size: 1.8rem;
    }

    .stats-container {
        gap: 1rem;
    }

    .stat-item {
        min-width: 45%;
    }
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}