/**
 * CERBERUS RP 1.0 — Site chrome
 * Design tokens + the shared navbar and footer.
 *
 * Loaded on EVERY player-facing page: public pages (with style.css) and the
 * account area (with dashboard.css + account.css). Selectors here are
 * namespaced (.navbar*, .nav-*, .np-*, .site-footer, .footer-*) so they never
 * fight either component sheet. The admin panel does not load this file.
 *
 * Palette and type match the in-game 1.0 UI (loading screen, HUD, menus):
 *   red #C80000 (deep #7F0A0A, bright #E62E2E) on near-black, gold for VIP/money,
 *   Russo One for display type, Chakra Petch for everything else.
 */

/* ============================================= */
/* TOKENS                                        */
/* ============================================= */
:root {
    /* Brand */
    --primary: #c80000;
    --primary-light: #e62e2e;
    --primary-dark: #7f0a0a;
    --primary-rgb: 200, 0, 0;
    --gold: #d9a441;
    --gold-light: #ecc777;
    --gold-rgb: 217, 164, 65;

    /* Surfaces (darkest → lightest) */
    --bg-deep: #060607;
    --bg-main: #0a0a0b;
    --bg-card: #111113;
    --bg-input: #17171a;
    --bg-hover: #1d1d21;
    --bg-raised: #222226;

    /* Borders */
    --border-light: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --border-primary: rgba(200, 0, 0, 0.35);
    --border-primary-hover: rgba(230, 46, 46, 0.6);

    /* Text */
    --text-primary: #f4f4f5;
    --text-secondary: #c9c9cf;
    --text-muted: #9a9aa3;
    --text-dark: #64646d;

    /* Status (semantic, deliberately not brand red) */
    --success: #22c55e;
    --success-light: #86efac;
    --error: #ef4444;
    --error-light: #fca5a5;
    --warning: #f5a623;
    --warning-light: #fcd34d;
    --info: #3b82f6;
    --info-light: #93c5fd;

    /* Discord */
    --discord: #5865F2;
    --discord-hover: #4752C4;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --gutter: 2rem;

    /* Shape — tighter, more "tactical" than the old rounded look */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-full: 9999px;

    /* Elevation & glow */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 24px rgba(200, 0, 0, 0.35);

    /* Type */
    --font-display: 'Russo One', 'Arial Black', sans-serif;
    --font-body: 'Chakra Petch', system-ui, sans-serif;
    --font-mono: 'Chakra Petch', 'Consolas', monospace;
    --font-code: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;

    /* Layout */
    --container: 1200px;
    --nav-height: 68px;

    /* Motion */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 768px) {
    :root { --gutter: 1rem; --nav-height: 60px; }
}

/* ============================================= */
/* SKIP LINK                                     */
/* ============================================= */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -60px;
    z-index: 2000;
    padding: 0.6rem 1rem;
    background: var(--primary);
    color: #fff;
    font: 600 0.9rem var(--font-body);
    border-radius: var(--radius-sm);
    text-decoration: none;
}
.skip-link:focus { top: 0.75rem; color: #fff; }

/* ============================================= */
/* NAVBAR                                        */
/* ============================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 11, 0.88);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    font-family: var(--font-body);
}

/* thin red rule under the bar, brightest in the middle */
.navbar::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 0, 0, 0.55) 50%, transparent);
    pointer-events: none;
}

.navbar-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-brand img {
    height: 40px;
    width: auto;
    display: block;
    filter: drop-shadow(0 0 10px rgba(200, 0, 0, 0.35));
}

.navbar-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.navbar-title span { color: var(--primary-light); }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav > li { list-style: none; }

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active { color: var(--text-primary); }

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: -0.2rem;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 10px rgba(200, 0, 0, 0.8);
}

.nav-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.4rem;
    padding: 0.55rem 1.15rem;
    background: linear-gradient(180deg, #d61414, #a80000);
    border: 1px solid rgba(255, 90, 90, 0.35);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.nav-link-btn:hover {
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), var(--shadow-glow);
    transform: translateY(-1px);
}

/* Dropdowns */
.nav-chevron {
    display: inline-block;
    opacity: 0.55;
    transition: transform 0.2s var(--ease), opacity 0.2s;
}

.nav-dropdown { position: relative; }
.nav-dropdown.active .nav-chevron { transform: rotate(180deg); opacity: 1; }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 210px;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    background: rgba(14, 14, 16, 0.98);
    border: 1px solid var(--border-strong);
    border-top: 2px solid var(--primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.nav-dropdown-right { left: auto; right: 0; }

.nav-dropdown.active .nav-dropdown-menu {
    display: block;
    animation: cerbDropIn 0.16s var(--ease);
}

@keyframes cerbDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-menu li { list-style: none; }

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}

.nav-dropdown-menu a .ic { color: var(--text-dark); }

.nav-dropdown-menu a:hover {
    background: rgba(200, 0, 0, 0.14);
    color: var(--text-primary);
}

.nav-dropdown-menu a:hover .ic { color: var(--primary-light); }
.nav-dropdown-menu a.nav-signout { color: var(--text-muted); }

.dropdown-divider {
    height: 1px;
    margin: 0.35rem 0.4rem;
    background: var(--border-light);
}

/* Signed-in user chip */
.nav-user { gap: 0.5rem; text-transform: none; letter-spacing: 0.02em; }

.nav-user-avatar {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 1px solid rgba(255, 90, 90, 0.35);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.8rem;
}

.nav-user-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hamburger */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 9px;
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.navbar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease), background 0.2s;
    transform-origin: center;
}

.navbar-toggle:hover { border-color: var(--primary); }
.navbar-toggle:hover span { background: var(--primary-light); }
.navbar-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; }
.navbar-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================= */
/* NOTIFICATION BELL & PANEL                     */
/* ============================================= */
.notif-bell-wrap {
    position: relative;
    display: flex;
    align-items: center;
    list-style: none;
}

.notif-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.notif-bell-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-light);
}

.notif-bell-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font: 700 0.62rem/16px var(--font-body);
    text-align: center;
    pointer-events: none;
    box-shadow: 0 0 0 2px var(--bg-main), 0 0 8px rgba(200, 0, 0, 0.7);
}

.notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 2rem);
    overflow: hidden;
    background: rgba(14, 14, 16, 0.98);
    border: 1px solid var(--border-strong);
    border-top: 2px solid var(--primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    font-family: var(--font-body);
}

.notif-panel.open { display: block; animation: cerbDropIn 0.16s var(--ease); }

.np-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.np-head-title {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.np-head-meta { font-size: 0.75rem; font-weight: 600; color: var(--primary-light); }

.np-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}

.np-card:last-child { border-bottom: none; }
.np-card:hover { background: rgba(200, 0, 0, 0.1); color: var(--text-primary); }

.np-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.np-icon .ic { width: 18px; height: 18px; }
.np-icon-app    { background: rgba(200, 0, 0, 0.12); border: 1px solid rgba(200, 0, 0, 0.3); color: var(--primary-light); }
.np-icon-ticket { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.25); color: var(--info-light); }

.np-body { flex: 1; min-width: 0; }
.np-title { font-size: 0.92rem; font-weight: 600; line-height: 1.2; color: var(--text-primary); }
.np-sub { margin-top: 2px; font-size: 0.78rem; color: var(--text-muted); }

.np-count {
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(200, 0, 0, 0.14);
    border: 1px solid rgba(200, 0, 0, 0.35);
    border-radius: var(--radius-sm);
    color: var(--primary-light);
    font-size: 0.8rem;
    font-weight: 700;
}

.np-empty {
    padding: 26px 16px;
    text-align: center;
    color: var(--text-dark);
    font-size: 0.86rem;
}

.np-empty-icon { display: flex; justify-content: center; margin-bottom: 6px; opacity: 0.45; }

/* ============================================= */
/* MOBILE NAV                                    */
/* ============================================= */
@media (max-width: 960px) {
    .navbar-toggle { display: flex; }
    .navbar-brand img { height: 34px; }
    .navbar-title { font-size: 1rem; }

    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 0 1rem;
        background: rgba(10, 10, 11, 0.99);
        border-bottom: 1px solid var(--border-strong);
        box-shadow: var(--shadow-lg);
    }

    .navbar-nav.open { display: flex; }
    .navbar-nav > li { width: 100%; }

    .navbar-nav > li > .nav-link {
        display: flex;
        width: 100%;
        padding: 0.9rem var(--gutter);
        border-radius: 0;
        font-size: 0.95rem;
    }

    .nav-link .nav-chevron { margin-left: auto; }
    .nav-link.active { color: var(--primary-light); background: rgba(200, 0, 0, 0.06); }
    .nav-link.active::after { left: 0; right: auto; top: 0; bottom: 0; width: 3px; height: auto; }

    .navbar-nav > li > .nav-link-btn {
        display: flex;
        justify-content: center;
        margin: 0.75rem var(--gutter) 0;
        padding: 0.8rem 1rem;
    }

    .nav-dropdown-menu,
    .nav-dropdown-right {
        position: static;
        min-width: 0;
        padding: 0 0 0.35rem;
        background: rgba(255, 255, 255, 0.02);
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .nav-dropdown.active .nav-dropdown-menu { animation: none; }
    .nav-dropdown-menu a { padding: 0.75rem var(--gutter) 0.75rem calc(var(--gutter) + 1rem); border-radius: 0; }
    .dropdown-divider { margin: 0.35rem var(--gutter); }

    /* the bell sits on its own row in the open menu */
    .notif-bell-wrap { order: 10; padding: 0.5rem var(--gutter) 0; }
    .notif-panel { right: auto; left: var(--gutter); top: calc(100% + 8px); }
    .nav-user-name { max-width: none; }
}

/* ============================================= */
/* SITE FOOTER                                   */
/* ============================================= */
.site-footer {
    position: relative;
    margin-top: 5rem;
    background: linear-gradient(180deg, rgba(200, 0, 0, 0.035), rgba(0, 0, 0, 0) 40%), var(--bg-deep);
    border-top: 1px solid var(--border-light);
    font-family: var(--font-body);
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 0, 0, 0.7), transparent);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding: 3.25rem 0 2.25rem;
}

.footer-brand-row {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    text-decoration: none;
}

.footer-brand-row img { height: 42px; width: auto; }

.footer-wordmark {
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.footer-wordmark span { color: var(--primary-light); }

.footer-tagline {
    max-width: 300px;
    margin: 0 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.footer-social { display: flex; gap: 0.6rem; }

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all 0.2s var(--ease);
}

.footer-social a:hover {
    color: #fff;
    background: rgba(200, 0, 0, 0.14);
    border-color: rgba(200, 0, 0, 0.5);
    transform: translateY(-2px);
}

.footer-col h4 {
    margin: 0 0 1.1rem;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.6rem; }

.footer-col a {
    color: var(--text-muted);
    font-size: 0.92rem;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col a:hover { color: var(--primary-light); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.4rem 0;
    border-top: 1px solid var(--border-light);
}

.footer-bottom p { margin: 0; color: var(--text-dark); font-size: 0.85rem; }

.footer-bottom-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

.footer-bottom-links a {
    color: var(--text-dark);
    font-size: 0.85rem;
    text-decoration: none;
}

.footer-bottom-links a:hover { color: var(--text-secondary); }

.site-footer .cerb-legal-notice {
    padding: 0 0 1.5rem;
    font-family: var(--font-body);
    color: var(--text-dark);
}

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.75rem 1rem; padding-top: 2.5rem; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}
