@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:wght@300;400;500;600;700&display=swap');

/* ================= RESET & BASE ================= */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Kantumruy Pro", sans-serif;
}

:root {
    --color-prime: #2563eb;
    --color-yellow: #f2e312;
    --color-text-dark: #1d1d1d;
    --menu-bg: #0d496a;
    --menu-border: #032368;
    --bg-page: #f0f4f8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
    --radius: 10px;
    --max-width: 1280px;
    --side-pad: 5%;
}

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;
    background: var(--bg-page);
    color: #222;
    line-height: 1.5;
}

body.no-scroll {
    overflow: hidden;
}

a {
    text-decoration: none;
}

/* ================= HEADER ================= */

header {
    width: 100%;
    padding: 14px var(--side-pad);
    background: #171717;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.logo div {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.logo span[style*="color:#2563eb"] {
    color: var(--color-prime) !important;
}

.logo span[style*="color:#fff"] {
    color: #fff !important;
}

/* ================= FILTER WRAPPER ================= */

.filter-wrapper {
    position: sticky;
    top: 0px; /* sits right below the sticky header */
    z-index: 90;
    background: var(--menu-bg);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

/* ================= MOBILE TOGGLE BAR ================= */

.mobile-filter-bar {
    display: none;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-yellow);
    color: #111;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1;
}

.mobile-filter-label {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.mobile-filter-toggle {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-filter-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ================= FILTER PANEL ================= */

.filter-panel {
    max-width: var(--max-width);
    margin: 0 auto;
}

.menu {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

menu {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px var(--side-pad);
    background: transparent;
    list-style: none;
}

.menu-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    min-width: 42px;
}

.menu-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

menu a {
    color: #fff;
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    transition: all 0.2s ease;
    white-space: nowrap;
}

menu a:hover {
    border-color: var(--color-yellow);
    color: var(--color-yellow);
    background: rgba(242, 227, 18, 0.08);
}

menu a.active {
    background: rgba(242, 227, 18, 0.15);
    border-color: var(--color-yellow);
    color: var(--color-yellow);
    font-weight: 600;
}

/* ================= OVERLAY ================= */

.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 80;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.menu-overlay.is-open {
    display: block;
}

/* ================= TABLE SECTION ================= */

.table {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 8px 0 40px;
}

.gr-table {
    padding: 24px var(--side-pad) 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Level header row */
.th-level {
    background: linear-gradient(135deg, #e8f0fe 0%, #dbeafe 100%);
    color: #1e3a5f;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 16px;
    border-bottom: 2px solid #bfdbfe;
    text-align: center;
    letter-spacing: 0.01em;
}

/* Column headers */
thead tr:nth-child(2) th {
    background: var(--menu-bg);
    color: #fff;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--menu-border);
    letter-spacing: 0.02em;
}

/* Cells */
td {
    padding: 11px 14px;
    font-size: 13.5px;
    border: 1px solid #e8edf3;
    color: #2d3748;
    vertical-align: middle;
}

/* First cell (number) */
td:first-child {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    width: 42px;
}

/* Row striping */
tbody tr:nth-child(even) {
    background: #f8fafc;
}

tbody tr:hover {
    background: #fae9003d;
    transition: background 0.15s ease;
}

/* No data row */
tbody tr td[colspan="6"] {
    text-align: center;
    color: #9ca3af;
    padding: 28px;
    font-size: 14px;
    font-style: italic;
}

/* ================= DESKTOP ENHANCEMENTS ================= */

@media (min-width: 1024px) {
    :root {
        --side-pad: 3%;
    }

    menu {
        gap: 18px;
    }

    menu a {
        font-size: 14px;
        padding: 7px 18px;
    }

    td, thead tr:nth-child(2) th {
        font-size: 14px;
        padding: 13px 16px;
    }

    .th-level {
        font-size: 17px;
        padding: 16px;
    }
}

/* ================= TABLET ================= */

@media (max-width: 1023px) and (min-width: 769px) {
    :root {
        --side-pad: 4%;
    }

    .gr-table {
        padding: 20px var(--side-pad) 0;
    }
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {

    :root {
        --side-pad: 12px;
    }

    header {
        padding: 12px var(--side-pad);
        top: 0;
    }

    .logo img {
        width: 28px;
        height: 28px;
    }

    .logo div {
        font-size: 15px;
    }

    /* Filter wrapper sticks below header */
    .filter-wrapper {
        top: 0px;
    }

    /* Show mobile toggle bar */
    .mobile-filter-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 11px var(--side-pad);
        background: var(--menu-bg);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Hide panel by default on mobile */
    .filter-panel {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 95;
        background: var(--menu-bg);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
        max-height: 80vh;
        overflow-y: auto;
        padding-bottom: 24px;
    }

    .filter-panel.is-open {
        display: block;
        animation: slideUp 0.25s ease;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }

    /* Handle bar at top of panel */
    .filter-panel::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        margin: 12px auto 8px;
    }

    menu {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px var(--side-pad);
        gap: 8px;
    }

    .menu-links {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    menu a {
        font-size: 13px;
        padding: 8px 16px;
    }

    /* TABLE: horizontally scrollable */
    .table {
        padding: 0 0 32px;
    }

    .gr-table {
        padding: 16px var(--side-pad) 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
        border-radius: 8px;
    }

    th, td {
        font-size: 13px;
        padding: 10px 12px;
        white-space: nowrap;
    }

    .th-level {
        font-size: 14px;
        padding: 12px;
        white-space: normal;
    }
}

/* ================= SMALL PHONES ================= */

@media (max-width: 380px) {
    .logo div {
        font-size: 13px;
    }

    menu a {
        font-size: 12px;
        padding: 7px 12px;
    }

    th, td {
        font-size: 12px;
        padding: 9px 10px;
    }
}