/* ============================================================
   _news.css
   ============================================================ */

.news-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    overflow: hidden;
    background: var(--card-bg);
    backdrop-filter: var(--lg-blur);
    -webkit-backdrop-filter: var(--lg-blur);
    border: var(--card-border);
    border-radius: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 992px) {
    .news-card {
        flex-direction: row;
        min-height: 280px;
    }
}

.news-img-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    background: rgba(10, 8, 24, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.news-detail-trigger {
    cursor: pointer;
}

.news-detail-trigger:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.34);
    outline-offset: -3px;
}

@media (min-width: 992px) {
    .news-img-container {
        width: 35%;
        min-height: auto;
    }
}

.news-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.95rem;
    gap: 1rem;
}

.news-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-badge.new_game { background: rgba(162, 76, 255, 0.2); color: var(--primary); border: 1px solid rgba(162, 76, 255, 0.4); }
.news-badge.update { background: rgba(255, 125, 0, 0.2); color: var(--secondary); border: 1px solid rgba(255, 125, 0, 0.4); }
.news-badge.new_feature { background: rgba(0, 210, 255, 0.2); color: #00d2ff; border: 1px solid rgba(0, 210, 255, 0.4); }
.news-badge.fix { background: rgba(80, 220, 150, 0.16); color: #64e6a8; border: 1px solid rgba(100, 230, 168, 0.34); }

.news-date {
    font-size: 0.85rem;
    color: var(--text-grey);
}

.news-card .news-title {
    font-size: clamp(1.55rem, 2.2vw, 2rem);
    font-weight: 900;
    line-height: 1.15;
    margin: 0 0 1.25rem;
    color: var(--text-color);
}

.news-text {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    flex: 1;
}

.news-summary {
    margin: 0 0 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
}

.news-text-blocks {
    display: grid;
    gap: 0.85rem;
}

.news-text-blocks h3 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.12rem, 1.7vw, 1.32rem);
    font-weight: 850;
    line-height: 1.25;
}

.news-text-blocks p {
    margin: 0;
}

.news-text-blocks + .news-highlight-list {
    margin-top: 1rem;
}

.news-highlight-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding-left: 1.15rem;
}

.news-highlight-list li {
    padding-left: 0.15rem;
}

.news-highlight-list li::marker {
    color: var(--primary);
}

.news-highlight-more {
    color: var(--text-grey);
    font-style: italic;
}

.news-text.news-detail-trigger {
    border-radius: 12px;
    transition: background 0.18s ease;
}

.news-text.news-detail-trigger:hover {
    background: rgba(255, 255, 255, 0.035);
}

.news-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Reactions */
.news-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    padding: 0.28rem;
    border-radius: 999px;
    background: rgba(13, 10, 28, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 8px 22px rgba(0, 0, 0, 0.18);
}

.reaction-btn {
    min-height: 32px;
    padding: 0.32rem 0.72rem;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid transparent;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: auto;
    box-shadow: none;
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateY(-1px);
}

.reaction-btn.active {
    background: rgba(162, 76, 255, 0.18);
    border-color: rgba(162, 76, 255, 0.38);
    color: var(--primary);
    box-shadow: 0 8px 22px rgba(162, 76, 255, 0.14);
}

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

.reaction-count {
    font-weight: 700;
    font-size: 0.8rem;
}

/* Comments */
.comments-toggle-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    padding: 0.48rem 0.85rem;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    min-width: auto;
    white-space: nowrap;
}

.comments-toggle-btn:hover {
    background: rgba(162, 76, 255, 0.14);
    border-color: rgba(162, 76, 255, 0.32);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.news-action-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    padding: 0.48rem 0.92rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

.news-action-btn:hover,
.news-action-btn:focus-visible {
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.news-action-btn-primary {
    background: rgba(162, 76, 255, 0.18);
    border-color: rgba(162, 76, 255, 0.38);
    color: var(--primary);
    box-shadow: 0 10px 24px rgba(162, 76, 255, 0.14);
}

.news-action-btn-primary:hover,
.news-action-btn-primary:focus-visible {
    background: rgba(162, 76, 255, 0.28);
    border-color: rgba(162, 76, 255, 0.55);
    color: #fff;
    box-shadow: 0 14px 32px rgba(162, 76, 255, 0.22);
}

.news-detail-btn {
    background: rgba(255, 255, 255, 0.045);
}

.reaction-btn:focus-visible,
.comments-toggle-btn:focus-visible,
.news-action-btn:focus-visible,
.filter-pill:focus-visible,
.news-comments-panel-close:focus-visible,
.news-detail-panel-close:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.34);
    outline-offset: 2px;
}

.comment-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.comment-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 15px;
    color: white;
    outline: none;
}

.comment-input:focus {
    border-color: var(--primary);
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px;
    position: relative;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.comment-user {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-grey);
}

.comment-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.comment-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255, 60, 60, 0.6);
    cursor: pointer;
    padding: 2px;
    font-size: 0.8rem;
    display: none;
}

.comment-item:hover .comment-delete {
    display: block;
}

.comments-panel-open {
    overflow: hidden;
}

.news-detail-panel-open {
    overflow: hidden;
}

.news-detail-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 2450;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.news-detail-panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.news-detail-panel {
    position: relative;
    width: min(920px, 100%);
    max-height: min(840px, calc(100vh - 2rem));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(18, 22, 38, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    transform: translateY(14px) scale(0.98);
    transition: transform 0.2s ease;
}

.news-detail-panel-overlay.active .news-detail-panel {
    transform: translateY(0) scale(1);
}

.news-detail-panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.news-detail-panel-close:hover {
    background: rgba(162, 76, 255, 0.28);
    border-color: rgba(162, 76, 255, 0.45);
    color: #fff;
    transform: translateY(-1px);
}

.news-detail-panel-body {
    flex: 1;
    overflow-y: auto;
}

.news-detail-hero {
    height: clamp(190px, 28vh, 300px);
    background: rgba(255, 255, 255, 0.04);
}

.news-detail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-detail-content {
    padding: 1.4rem;
}

.news-detail-title {
    margin: 0 0 1rem;
    color: var(--text-color);
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    font-weight: 850;
    line-height: 1.12;
}

.news-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    padding-top: 0.8rem;
}

.news-comments-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.news-comments-panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.news-comments-panel {
    width: min(640px, 100%);
    max-height: min(760px, calc(100vh - 2rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(18, 22, 38, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.2s ease;
}

.news-comments-panel-overlay.active .news-comments-panel {
    transform: translateY(0) scale(1);
}

.news-comments-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.news-comments-panel-kicker {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.news-comments-panel-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.25;
}

.news-comments-panel-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.news-comments-panel-close:hover {
    background: rgba(162, 76, 255, 0.16);
    border-color: rgba(162, 76, 255, 0.34);
    color: var(--primary);
    transform: translateY(-1px);
}

.news-comments-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.news-comments-panel-input {
    margin: 0;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.14);
}

.news-comments-panel-input .comment-input {
    min-height: 42px;
    border-radius: 999px;
}

/* Filter Bar */
.news-filter-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 2.5rem;
    justify-content: center;
    padding: 0.34rem;
    border-radius: 999px;
    background: rgba(13, 10, 28, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.filter-pill {
    min-height: 36px;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.58);
    padding: 0.48rem 0.95rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    min-width: auto;
    white-space: nowrap;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.filter-pill.active {
    background: rgba(162, 76, 255, 0.18);
    border-color: rgba(162, 76, 255, 0.34);
    color: var(--primary);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 10px 24px rgba(0, 0, 0, 0.18);
}

@media (max-width: 767px) {
    .news-card .news-title { font-size: 1.25rem; }
    .news-card { border-radius: 16px; }
    .news-footer { align-items: stretch; }
    .news-reactions {
        width: 100%;
        border-radius: 18px;
    }
    .reaction-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
    .news-footer > .d-flex {
        width: 100%;
        justify-content: space-between;
    }
    .comments-toggle-btn,
    .news-action-btn {
        flex: 1;
    }
    .news-detail-panel-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .news-detail-panel {
        width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
    }
    .news-detail-content {
        padding: 1.15rem;
    }
    .news-detail-actions {
        flex-direction: column;
    }
    .news-detail-actions .news-action-btn {
        width: 100%;
    }
    .news-filter-bar {
        width: 100%;
        border-radius: 18px;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .news-filter-bar::-webkit-scrollbar { display: none; }
    .filter-pill {
        padding: 0.44rem 0.82rem;
        font-size: 0.8rem;
        flex: 0 0 auto;
    }
    .news-comments-panel-overlay { align-items: flex-end; padding: 0; }
    .news-comments-panel {
        width: 100%;
        max-height: 88vh;
        border-radius: 16px 16px 0 0;
    }
    .news-comments-panel-input {
        flex-direction: column;
    }
    .news-comments-panel-input .btn {
        width: 100%;
    }
    .news-comments-panel-input .news-action-btn {
        width: 100%;
    }
}
