/**
 * @file news.css
 * @description Modern, responsive styling for Marwadi Chess What's New & Product Updates feed.
 */

.news-container {
    max-width: 1080px;
    margin: 0 auto 40px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.news-header-banner {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.news-header-title {
    font-size: clamp(22px, 4.5vw, 30px);
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.news-header-desc {
    color: #94a3b8;
    font-size: 14.5px;
    line-height: 1.6;
    margin: 0;
    max-width: 650px;
}

.news-stats-pill {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.news-stat-item {
    text-align: center;
}

.news-stat-num {
    font-size: 20px;
    font-weight: 800;
    color: #38bdf8;
}

.news-stat-lbl {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Filter & Search Bar */
.news-toolbar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .news-toolbar,
body.dark-theme .news-toolbar,
html[data-theme="dark"] .news-toolbar {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

.news-filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.news-filter-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.news-filter-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}

.news-filter-btn.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

[data-theme="dark"] .news-filter-btn,
body.dark-theme .news-filter-btn,
html[data-theme="dark"] .news-filter-btn {
    background: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .news-filter-btn:hover,
body.dark-theme .news-filter-btn:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

.news-search-box {
    position: relative;
    min-width: 240px;
    flex: 1 1 auto;
    max-width: 320px;
}

.news-search-input {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    color: #0f172a;
    padding: 9px 14px 9px 36px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.news-search-input:focus {
    border-color: #38bdf8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.news-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}

[data-theme="dark"] .news-search-input,
body.dark-theme .news-search-input,
html[data-theme="dark"] .news-search-input {
    background: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
}

/* Timeline & Feed Cards */
.news-feed-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px 26px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    position: relative;
    box-sizing: border-box;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
}

[data-theme="dark"] .news-card,
body.dark-theme .news-card,
html[data-theme="dark"] .news-card {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .news-card:hover,
body.dark-theme .news-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
}

.news-card.is-pinned {
    border-left: 4px solid #f59e0b;
}

.news-card-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.news-card-content {
    flex: 1;
    min-width: 0;
}

.news-card-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.news-badge-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.news-badge-pill {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.news-version-pill {
    background: #0f172a;
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-family: monospace;
    font-weight: 700;
}

.news-pinned-tag {
    color: #f59e0b;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.news-date {
    color: #94a3b8;
    font-size: 12.5px;
    font-weight: 600;
}

.news-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

[data-theme="dark"] .news-card-title,
body.dark-theme .news-card-title,
html[data-theme="dark"] .news-card-title {
    color: #f8fafc !important;
}

.news-card-msg {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

[data-theme="dark"] .news-card-msg,
body.dark-theme .news-card-msg,
html[data-theme="dark"] .news-card-msg {
    color: #cbd5e1 !important;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.news-action-link {
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.news-action-link:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.news-empty-state {
    background: #1e293b;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .news-header-banner {
        padding: 20px 16px;
    }

    .news-header-title {
        font-size: 20px;
    }

    .news-stats-pill {
        width: 100%;
        justify-content: space-around;
        box-sizing: border-box;
    }

    .news-toolbar {
        padding: 12px 14px;
        flex-direction: column;
        align-items: stretch;
    }

    .news-search-box {
        max-width: 100%;
    }

    .news-card {
        padding: 16px 14px;
        flex-direction: column;
        gap: 14px;
    }

    .news-card-icon-wrap {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .news-card-footer {
        justify-content: stretch;
    }

    .news-action-link {
        width: 100%;
        justify-content: center;
        text-align: center;
        min-height: 40px;
        box-sizing: border-box;
    }
}
