/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    background: #f1f3f4;
    color: #202124;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Top Bar ===== */
.top-bar {
    background: #1a1a2e;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 1px;
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* ===== Tab Bar ===== */
.tab-bar {
    background: #fff;
    border-bottom: 1px solid #dadce0;
    position: sticky;
    top: 56px;
    /* below top-bar */
    z-index: 99;
    display: flex;
    justify-content: center;
    gap: 0;
}

.tab-btn {
    padding: 14px 32px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #5f6368;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    font-family: inherit;
}

.tab-btn:hover {
    color: #202124;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

/* ===== Three-Column Page Layout ===== */
.page-layout {
    display: grid;
    grid-template-columns: 240px 1fr 220px;
    max-width: 1480px;
    margin: 0 auto;
    gap: 24px;
    padding: 24px;
    align-items: start;
}

/* ===== Sidebars ===== */
.sidebar {
    position: sticky;
    top: 120px;
}

.sidebar-section {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #dadce0;
    padding: 16px;
    margin-bottom: 16px;
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8eaed;
}

/* ===== Guide Cards (Left Sidebar) ===== */
.guide-card {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    cursor: pointer;
    border: 1px solid #e8eaed;
    background: #fff;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.guide-card:last-child {
    margin-bottom: 0;
}

.guide-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(32, 33, 36, 0.12);
    border-color: #1a73e8;
}

.guide-card:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(32, 33, 36, 0.1);
}

.guide-card-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    background: #e8eaed;
    transition: opacity 0.25s ease;
}

.guide-card:hover .guide-card-img {
    opacity: 0.9;
}

.guide-card-body {
    padding: 10px 12px;
}

.guide-card-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #202124;
    line-height: 1.4;
    margin-bottom: 4px;
}

.guide-card-desc {
    font-size: 0.75rem;
    color: #5f6368;
    line-height: 1.4;
}

/* ===== Rating Legend (Right Sidebar) ===== */
.legend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}

.legend-label {
    font-size: 0.78rem;
    color: #3c4043;
    line-height: 1.4;
}

.about-text {
    font-size: 0.8rem;
    color: #5f6368;
    line-height: 1.7;
}

.about-text a {
    color: #1a73e8;
    text-decoration: none;
}

.about-text a:hover {
    text-decoration: underline;
}

/* ===== Container (Main Column) ===== */
.container {
    min-width: 0;
    padding: 0 0 80px;
}

.placeholder-text {
    text-align: center;
    padding: 80px 0;
    color: #5f6368;
}

/* ===== Class Intro ===== */
.class-intro {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ===== Weapon Card ===== */
.weapon-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #dadce0;
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.weapon-card:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.1);
}

.weapon-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    gap: 16px;
}

.weapon-header:hover {
    background: #f8f9fa;
}

.weapon-thumb {
    width: 160px;
    height: 88px;
    object-fit: contain;
    border-radius: 6px;
    background: #f1f3f4;
    flex-shrink: 0;
    border: 1px solid #e8eaed;
}

.weapon-title-area {
    flex-grow: 1;
    min-width: 0;
}

.weapon-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #202124;
}

.weapon-base-build-preview {
    font-size: 0.85rem;
    color: #5f6368;
    margin-top: 4px;
}

.weapon-base-build-preview span {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: #1a73e8;
}

.weapon-meta {
    font-size: 0.8rem;
    color: #9aa0a6;
    margin-top: 4px;
}

.expand-icon {
    font-size: 1.2rem;
    color: #5f6368;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.weapon-card.open .expand-icon {
    transform: rotate(180deg);
}

/* ===== Weapon Body (Expandable) ===== */
.weapon-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.weapon-card.open .weapon-body {
    max-height: 20000px;
    /* large enough */
}

.weapon-body-inner {
    padding: 0 20px 20px;
    border-top: 1px solid #e8eaed;
}

/* Large banner image at top of expanded view */
.weapon-banner {
    margin: 0 -20px;
    padding: 0;
    background: #f1f3f4;
    border-bottom: 1px solid #e8eaed;
    text-align: center;
}

.weapon-banner-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: 0 auto;
    padding: 16px 0;
    object-fit: contain;
}

/* Base info */
.base-section {
    padding: 16px 0;
    border-bottom: 1px solid #e8eaed;
}

.base-section:last-child {
    border-bottom: none;
}

.base-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.base-build-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    color: #1a73e8;
    font-weight: 700;
}

.base-desc-text {
    font-size: 0.9rem;
    color: #3c4043;
    line-height: 1.7;
}

/* Ratings summary bar */
.ratings-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 0;
    border-bottom: 1px solid #e8eaed;
}

.rating-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

.rating-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Score dot colors */
.dot-5 {
    background: #d93025;
}

.dot-4 {
    background: #e8710a;
}

.dot-3 {
    background: #188038;
}

.dot-2 {
    background: #1a73e8;
}

.dot-1 {
    background: #9aa0a6;
}

/* ===== Overclock List ===== */
.oc-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #5f6368;
    padding: 16px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oc-item {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid #dadce0;
    background: #f8f9fa;
}

.oc-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.oc-item-name {
    font-weight: 700;
    font-size: 1rem;
    color: #202124;
}

.oc-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.oc-build {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: #1a73e8;
    margin-bottom: 8px;
    line-height: 1.5;
}

.oc-desc {
    font-size: 0.88rem;
    color: #3c4043;
    line-height: 1.7;
}

/* OC border colors by score */
.oc-score-5 {
    border-left-color: #d93025;
}

.oc-score-4 {
    border-left-color: #e8710a;
}

.oc-score-3 {
    border-left-color: #188038;
}

.oc-score-2 {
    border-left-color: #1a73e8;
}

.oc-score-1 {
    border-left-color: #9aa0a6;
}

.oc-score-0 {
    border-left-color: #dadce0;
}

/* Score badge bg colors */
.bg-5 {
    background: #d93025;
}

.bg-4 {
    background: #e8710a;
}

.bg-3 {
    background: #188038;
}

.bg-2 {
    background: #1a73e8;
}

.bg-1 {
    background: #9aa0a6;
}

.bg-0 {
    background: #dadce0;
    color: #5f6368;
}

/* ===== Combinations Section ===== */
.combos-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #dadce0;
    margin-top: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.combos-header {
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 700;
    color: #202124;
    border-bottom: 1px solid #e8eaed;
    background: #f8f9fa;
}

.combo-item {
    padding: 12px 20px;
    font-size: 0.9rem;
    color: #3c4043;
    line-height: 1.6;
    border-bottom: 1px solid #f1f3f4;
}

.combo-item:last-child {
    border-bottom: none;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 24px;
    font-size: 0.8rem;
    color: #5f6368;
    border-top: 1px solid #dadce0;
    background: #fff;
}

.footer a {
    color: #1a73e8;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .page-layout {
        grid-template-columns: 1fr;
        max-width: 960px;
        padding: 24px;
    }

    .sidebar {
        display: none;
    }
}

@media (max-width: 640px) {
    .tab-btn {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .page-layout {
        padding: 16px 12px;
    }

    .weapon-header {
        padding: 12px 14px;
    }

    .weapon-thumb {
        width: 100px;
        height: 55px;
    }

    .weapon-name {
        font-size: 0.95rem;
    }

    .weapon-body-inner {
        padding: 0 14px 16px;
    }
}

/* ===== Guide Modal ===== */
body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 92%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e8eaed;
    background: #f8f9fa;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #202124;
    margin: 0;
    line-height: 1.4;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #5f6368;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #e8eaed;
    color: #202124;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Modal article intro */
.modal-intro {
    font-size: 0.9rem;
    color: #5f6368;
    line-height: 1.7;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8eaed;
}

.modal-author {
    font-size: 0.78rem;
    color: #9aa0a6;
    margin-top: 8px;
}

/* Modal section headings */
.modal-section-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1a73e8;
    display: inline-block;
}

.modal-section-heading:first-child {
    margin-top: 0;
}

/* Subsection headings */
.modal-section {
    margin-top: 24px;
}

.modal-section:first-of-type {
    margin-top: 0;
}

.modal-subsection {
    margin: 20px 0 8px;
}

.modal-subsection-heading {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a73e8;
    margin-bottom: 4px;
}

.modal-section.role-theme-scout .modal-item,
.modal-subsection.role-theme-scout .modal-item {
    border-left-color: #1a73e8;
}

.modal-section.role-theme-driller .modal-item,
.modal-subsection.role-theme-driller .modal-item {
    border-left-color: #c58b00;
}

.modal-section.role-theme-gunner .modal-item,
.modal-subsection.role-theme-gunner .modal-item {
    border-left-color: #188038;
}

.modal-section.role-theme-engineer .modal-item,
.modal-subsection.role-theme-engineer .modal-item {
    border-left-color: #d93025;
}

.modal-subsection-intro {
    font-size: 0.82rem;
    color: #5f6368;
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Modal item cards */
.modal-item {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #dadce0;
    background: #f8f9fa;
    transition: box-shadow 0.2s;
}

.modal-item:hover {
    box-shadow: 0 2px 8px rgba(32, 33, 36, 0.08);
}

.modal-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.modal-item-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #202124;
}

.modal-item-rating {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.modal-item-build {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    color: #1a73e8;
    margin-bottom: 6px;
    line-height: 1.5;
}

.modal-item-desc {
    font-size: 0.85rem;
    color: #3c4043;
    line-height: 1.7;
    white-space: pre-line;
}

/* Modal item rating levels */
.modal-item.rating-5 {
    border-left-color: #d93025;
}

.modal-item.rating-4 {
    border-left-color: #e8710a;
}

.modal-item.rating-3 {
    border-left-color: #188038;
}

.modal-item.rating-2 {
    border-left-color: #1a73e8;
}

.modal-item.rating-1 {
    border-left-color: #9aa0a6;
}

.rating-bg-5 {
    background: #d93025;
}

.rating-bg-4 {
    background: #e8710a;
}

.rating-bg-3 {
    background: #188038;
}

.rating-bg-2 {
    background: #1a73e8;
}

.rating-bg-1 {
    background: #9aa0a6;
}

/* Combos badge */
.modal-combos {
    font-size: 0.85rem;
    color: #3c4043;
    background: #e8f0fe;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0 16px;
    line-height: 1.6;
}

.modal-combos strong {
    color: #1a73e8;
}

/* Modal footer */
.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #e8eaed;
    background: #f8f9fa;
    text-align: center;
    flex-shrink: 0;
}

.modal-source-link {
    font-size: 0.85rem;
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.modal-source-link:hover {
    color: #174ea6;
    text-decoration: underline;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}
