/* =========================================
   Current Affairs Premium Design
   ========================================= */

/* --- Hero Section --- */
.news-hero {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 24px;
    padding: 3.5rem 2rem;
    text-align: center;
    color: white;
    overflow: hidden;
    margin-bottom: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.3);
}

.hero-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 0;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: #4f46e5;
    top: -100px;
    left: -50px;
    animation: float 8s ease-in-out infinite alternate;
}

.shape-2 {
    width: 250px;
    height: 250px;
    background: #0ea5e9;
    bottom: -50px;
    right: -50px;
    animation: float 10s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #38bdf8;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.news-hero p {
    font-size: 1.1rem;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

/* Hero Stats Row */
.hero-stats-row {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 16px;
    gap: 2rem;
}

.h-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hs-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.hs-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
}

.h-stat-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
}

/* --- Filter Bar --- */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.7rem 1.5rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.filter-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

/* --- News Grid --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
}

.news-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border-color: transparent;
}

.news-image {
    height: 220px;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}

.news-date-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.news-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-tags {
    margin-bottom: 1rem;
}

.news-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.news-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    transition: color 0.2s;
}

.news-card:hover .news-title {
    color: var(--primary-color);
}

.news-excerpt {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more-btn {
    background: none;
    border: none;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s;
}

.read-more-btn:hover {
    gap: 0.75rem;
}

.bookmark-btn {
    background: #f8fafc;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
}

.bookmark-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* --- Mobile Optimizations --- */
@media (max-width: 768px) {
    .news-hero {
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
        margin-bottom: 2rem;
    }

    .news-hero h1 {
        font-size: 2rem;
    }

    .hero-stats-row {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        padding: 1rem;
        gap: 0.5rem;
    }

    .h-stat-divider {
        height: 25px;
    }
    
    .filter-container {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
        margin-bottom: 2rem;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
    }
    
    .filter-btn {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* Mobile News Grid */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .news-card {
        border-radius: 16px;
    }

    .news-image {
        height: 180px;
    }

    .news-content {
        padding: 1.25rem;
    }

    .news-title {
        font-size: 1.15rem;
    }

    .news-excerpt {
        font-size: 0.9rem;
        -webkit-line-clamp: 3;
    }
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none; /* Changed to none to ensure it is hidden */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 24px;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: rgba(0,0,0,0.05);
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: #ef4444;
    color: white;
}

.modal-body {
    padding: 2.5rem;
}

.modal-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-category {
    background: #eff6ff;
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.modal-date {
    color: #64748b;
    font-size: 0.9rem;
}

.modal-body h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.modal-image-wrapper {
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.modal-image-wrapper img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 350px;
}

.modal-text {
    font-size: 1.05rem;
    color: #334155;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.modal-footer-actions {
    display: flex;
    gap: 1rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
    flex-wrap: wrap;
}

.small-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    width: auto;
}

/* Modal Enhancements merged */
.modal-content {
    border-radius: 24px;
}

.modal-header {
    margin-bottom: 0.5rem;
}

.modal-category {
    font-size: 0.75rem;
}

.modal-body h2 {
    font-size: 1.6rem;
    font-weight: 800;
}

.modal-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #334155;
}
