/* News Page Styles */

/* No-scroll layout - fixed viewport height */
.news-page {
    overflow: hidden;
    height: 100vh;
}

.news-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 80px 20px 15px; /* 80px top for header */
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    padding-bottom: 72px; /* Footer space */
}

/* Sticky Filter Bar Container */
.news-filter-bar-container {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    padding-bottom: 5px;
    width: 100%;
}

/* News Grid - scrollable content area */
#newsContent {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    padding-right: 5px;
    padding-top: 5px;
    width: 100%;
    scrollbar-gutter: stable;
}

/* Custom scrollbar for news content - matches leaderboard */
#newsContent::-webkit-scrollbar,
.news-detail-content::-webkit-scrollbar {
    width: 6px;
}

#newsContent::-webkit-scrollbar-track,
.news-detail-content::-webkit-scrollbar-track {
    background: rgba(255, 149, 0, 0.05);
    border-radius: 3px;
}

#newsContent::-webkit-scrollbar-thumb,
.news-detail-content::-webkit-scrollbar-thumb {
    background: rgba(255, 149, 0, 0.25);
    border-radius: 3px;
}

#newsContent::-webkit-scrollbar-thumb:hover,
.news-detail-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 149, 0, 0.4);
}

/* News Type Filter Toggle */
.news-filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    flex-shrink: 0;
}

.news-type-selector {
    display: flex;
    gap: 3px;
    background: rgba(20, 28, 40, 0.95);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 149, 0, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.news-type-btn {
    background: transparent;
    border: none;
    color: rgba(176, 196, 222, 0.7);
    padding: 6px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

.news-type-btn:hover {
    background: rgba(255, 149, 0, 0.1);
    color: rgba(255, 200, 140, 0.95);
}

.news-type-btn.active {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.2) 0%, rgba(255, 119, 0, 0.12) 100%);
    color: #FF9500;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.15);
}

.news-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
    width: 100%;
}

/* News Card */
.news-card {
    background: linear-gradient(145deg, rgba(30, 40, 55, 0.9) 0%, rgba(20, 28, 40, 0.95) 100%);
    border: 1px solid rgba(255, 149, 0, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    min-height: 120px;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 149, 0, 0.5);
    box-shadow: 0 8px 32px rgba(255, 149, 0, 0.15);
}

.news-card-content {
    padding: 16px 20px;
    position: relative;
}

.news-card-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 20px;
    margin-bottom: 8px;
}

.news-card-badge.patch {
    background: rgba(255, 149, 0, 0.2);
    color: #FF9500;
    border: 1px solid rgba(255, 149, 0, 0.3);
}

.news-card-badge.event {
    background: rgba(100, 200, 100, 0.2);
    color: #64c864;
    border: 1px solid rgba(100, 200, 100, 0.3);
}

.news-card-badge.maintenance {
    background: rgba(100, 150, 255, 0.2);
    color: #6496ff;
    border: 1px solid rgba(100, 150, 255, 0.3);
}

.news-card-badge.promotion {
    background: rgba(200, 100, 200, 0.2);
    color: #c864c8;
    border: 1px solid rgba(200, 100, 200, 0.3);
}

.news-card-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #dce7ff;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.news-card-excerpt {
    color: rgba(200, 220, 245, 0.6);
    font-size: 0.85em;
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85em;
    color: rgba(200, 220, 245, 0.5);
}

.news-card-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.news-card-read-more {
    color: #FF9500;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* News Detail View - Full height scrollable */
.news-detail {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-detail-header {
    flex-shrink: 0;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.08) 0%, rgba(255, 200, 100, 0.04) 100%);
    border-radius: 10px;
    border: 1px solid rgba(255, 149, 0, 0.15);
    flex-wrap: wrap;
}

.news-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #FF9500;
    text-decoration: none;
    font-size: 0.9em;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.2);
    transition: all 0.2s ease;
    cursor: pointer;
}

.news-back-btn:hover {
    background: rgba(255, 149, 0, 0.2);
    border-color: rgba(255, 149, 0, 0.4);
}

.news-detail-title {
    font-size: 1.4em;
    font-weight: 700;
    color: #dce7ff;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    color: rgba(200, 220, 245, 0.6);
    font-size: 0.85em;
}

.news-detail-meta .news-card-badge {
    margin-bottom: 0;
}

.news-detail-content {
    flex: 1;
    overflow-y: auto;
    background: linear-gradient(145deg, rgba(30, 40, 55, 0.9) 0%, rgba(20, 28, 40, 0.95) 100%);
    border: 1px solid rgba(255, 149, 0, 0.15);
    border-radius: 16px;
    padding: 25px;
    line-height: 1.7;
}

.news-detail-content h2 {
    color: #FF9500;
    font-size: 1.4em;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 149, 0, 0.2);
}

.news-detail-content h2:first-child {
    margin-top: 0;
}

.news-detail-content h3 {
    color: #dce7ff;
    font-size: 1.15em;
    margin: 25px 0 12px 0;
}

.news-detail-content h4 {
    color: rgba(200, 220, 245, 0.9);
    font-size: 1em;
    margin: 20px 0 10px 0;
}

/* Translation Disclaimer - inside detail content */
.translation-disclaimer {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 200, 100, 0.1);
    border: 1px solid rgba(255, 200, 100, 0.3);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 0.85em;
    color: rgba(255, 200, 100, 0.9);
}

.translation-disclaimer .disclaimer-icon {
    font-size: 1.1em;
}

.news-detail-content p {
    color: rgba(200, 220, 245, 0.85);
    margin: 0 0 16px 0;
}

.news-detail-content ul,
.news-detail-content ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
    color: rgba(200, 220, 245, 0.85);
}

.news-detail-content li {
    margin-bottom: 8px;
}

.news-detail-content strong {
    color: #dce7ff;
}

.news-detail-content em {
    color: #FF9500;
}

.news-detail-content .highlight-box {
    background: rgba(255, 149, 0, 0.1);
    border-left: 4px solid #FF9500;
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.news-detail-content .warning-box {
    background: rgba(255, 100, 100, 0.1);
    border-left: 4px solid #ff6464;
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.news-detail-content .info-box {
    background: rgba(100, 150, 255, 0.1);
    border-left: 4px solid #6496ff;
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

/* Source box at bottom of articles */
.news-source-box {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1) 0%, rgba(255, 200, 100, 0.05) 100%);
    border: 1px solid rgba(255, 149, 0, 0.25);
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 30px;
    text-align: center;
}

.news-source-box p {
    margin: 0;
    color: rgba(200, 220, 245, 0.8);
    font-size: 0.95em;
}

.news-source-box a {
    color: #FF9500;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.news-source-box a:hover {
    color: #ffb347;
    text-decoration: underline;
}

.news-detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9em;
}

.news-detail-content th,
.news-detail-content td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 149, 0, 0.1);
}

.news-detail-content th {
    background: rgba(255, 149, 0, 0.1);
    color: #FF9500;
    font-weight: 600;
}

.news-detail-content tr:hover td {
    background: rgba(255, 149, 0, 0.05);
}

/* Class-specific styling */
.class-section {
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 149, 0, 0.1);
}

.class-section h4 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.buff {
    color: #64c864;
}

.nerf {
    color: #ff6464;
}

.change {
    color: #6496ff;
}

/* Loading State */
.news-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(200, 220, 245, 0.6);
}

.news-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 149, 0, 0.2);
    border-top-color: #FF9500;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(200, 220, 245, 0.6);
}

.news-empty-icon {
    font-size: 4em;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .news-container {
        padding: 70px 15px 60px; /* Keep header offset on mobile */
        height: 100vh;
    }

    .news-filter-bar {
        margin-bottom: 10px;
    }

    .news-type-btn {
        padding: 5px 12px;
        font-size: 0.8rem;
    }

    .news-grid {
        gap: 12px;
    }

    .news-card-image {
        height: 80px;
        font-size: 2em;
    }

    .news-card-content {
        padding: 12px;
    }

    .news-card-title {
        font-size: 1em;
    }

    .news-detail {
        min-height: 0;
        overflow: hidden;
    }

    .news-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
        margin-bottom: 8px;
    }

    .news-detail-title {
        font-size: 1.1em;
    }

    .news-detail-content {
        padding: 15px;
        min-height: 0;
        flex: 1;
        overflow-y: auto;
    }

    .news-detail-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .translation-disclaimer {
        padding: 8px 12px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .news-container {
        padding: 65px 10px 55px; /* Smaller header offset on very small screens */
    }

    .news-type-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .news-type-btn {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .news-card-image {
        height: 60px;
        font-size: 1.8em;
    }

    .news-detail-header {
        padding: 10px 12px;
        margin-bottom: 8px;
        gap: 8px;
    }

    .news-detail-title {
        font-size: 1em;
    }

    .news-back-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .news-detail-meta {
        font-size: 0.75em;
        gap: 6px;
    }

    .news-detail-content {
        padding: 12px;
        min-height: 0;
        overflow-y: auto;
    }

    .news-detail-content h2 {
        font-size: 1.1em;
    }

    .news-detail-content h3 {
        font-size: 1em;
    }

    .class-section {
        padding: 12px;
    }
}
