/* =============================================
   SHARPFOOTY DESIGN SYSTEM
   "Bloomberg terminal for AFL betting"
   Quantitative · Transparent · Calm
   ============================================= */

/* === DESIGN TOKENS === */
:root {
    /* --- Backgrounds --- */
    --bg-primary: #0f1724;
    --bg-card: #1a2332;
    --bg-elevated: #243044;

    /* --- Text --- */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #6b7280;

    /* --- Accent --- */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-dim: rgba(59,130,246,0.12);

    /* --- Semantic colours --- */
    --green: #22c55e;
    --green-dim: rgba(34,197,94,0.12);
    --red: #ef4444;
    --red-dim: rgba(239,68,68,0.12);
    --amber: #f59e0b;
    --amber-dim: rgba(245,158,11,0.12);

    /* --- Border --- */
    --border: #2d3a4a;

    /* --- Typography --- */
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* --- Type scale (px) --- */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 32px;
    --text-4xl: 40px;

    /* --- Spacing (4px base unit) --- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* --- Layout --- */
    --max-width: 1200px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --nav-height: 56px;

    /* -------------------------------------------------------
       LEGACY ALIASES
       Existing inline styles on predictions.html, multi-builder,
       and disclaimer reference these short variable names.
       Maps old palette → new palette so pages work without
       mass find-and-replace.
       ------------------------------------------------------- */

    /* Backgrounds (short) */
    --bg: #0f1724;
    --bg2: #1a2332;
    --bg3: #1a2332;
    --bg4: #243044;
    --bg5: #243044;

    /* Borders (short) */
    --bd: #2d3a4a;
    --bd2: #2d3a4a;

    /* Green (short) */
    --g: #22c55e;
    --g-hover: #16a34a;
    --gd: rgba(34,197,94,0.12);

    /* Amber (short) */
    --a: #f59e0b;
    --ad: rgba(245,158,11,0.12);

    /* Red (short) */
    --r: #ef4444;
    --rd: rgba(239,68,68,0.12);

    /* Text (short) */
    --t1: #ffffff;
    --t2: #94a3b8;
    --t3: #6b7280;
    --t4: #374151;

    /* Multi-builder readable aliases */
    --bg-deep: #0f1724;
    --bg-base: #1a2332;
    --bg-card-hover: #1e2940;
    --border-light: #2d3a4a;
    --blue: #3b82f6;
    --blue-dim: rgba(59,130,246,0.12);
    --text-faint: #374151;
}

/* === RESET === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--text-base);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

img, svg {
    display: block;
    max-width: 100%;
}

button, input, select, textarea {
    font-family: inherit;
}

/* === LAYOUT === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* === NAV === */
#site-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
}

#site-nav .nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

#site-nav .logo {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.03em;
}

#site-nav .logo span {
    color: var(--accent);
}

/* Desktop nav links */
#site-nav .nav-links {
    display: flex;
    gap: var(--space-1);
    align-items: center;
}

#site-nav .nav-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}

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

#site-nav .nav-link.active {
    color: var(--accent);
    background: var(--accent-dim);
}

/* Hamburger (mobile only) */
#site-nav .hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    flex-direction: column;
    gap: 5px;
    z-index: 102;
}

#site-nav .hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
}

/* Hamburger → X animation */
#site-nav .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
#site-nav .hamburger.active span:nth-child(2) {
    opacity: 0;
}
#site-nav .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* === MOBILE DRAWER === */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(2px);
}

.nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-drawer.open {
    transform: translateX(0);
}

.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border);
    min-height: var(--nav-height);
}

.nav-drawer-header .logo {
    font-size: var(--text-lg);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.nav-drawer-header .logo span {
    color: var(--accent);
}

.nav-drawer-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 24px;
    padding: var(--space-2);
    line-height: 1;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}

.nav-drawer-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.nav-drawer-links {
    padding: var(--space-4) 0;
    flex: 1;
}

.nav-drawer-links a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}

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

.nav-drawer-links a.active {
    color: var(--accent);
    background: var(--accent-dim);
}

.nav-drawer-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-2) var(--space-6);
}

.nav-drawer-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
}

.nav-drawer-footer a {
    display: block;
    padding: var(--space-2) 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
    transition: color 0.15s;
}

.nav-drawer-footer a:hover {
    color: var(--text-secondary);
}

/* === FOOTER === */
#site-footer {
    padding: var(--space-10) 0 var(--space-6);
    border-top: 1px solid var(--border);
}

/* Top row: brand | nav | responsible */
#site-footer .footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-8);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

#site-footer .footer-brand {
    flex-shrink: 0;
}

#site-footer .footer-logo {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: var(--space-1);
}

#site-footer .footer-logo span {
    color: var(--accent);
}

#site-footer .footer-tagline {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

#site-footer .footer-nav {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
}

#site-footer .footer-nav a {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.15s;
}

#site-footer .footer-nav a:hover {
    color: var(--accent);
}

#site-footer .footer-responsible {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
    flex-shrink: 0;
}

#site-footer .footer-responsible-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

#site-footer .footer-responsible a {
    font-size: var(--text-xs);
    color: var(--accent);
    transition: color 0.15s;
}

/* Bottom row: legal */
#site-footer .footer-bottom {
    text-align: center;
}

#site-footer .footer-bottom p {
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
}

#site-footer .footer-bottom a {
    color: var(--accent);
}

#site-footer .footer-bottom strong {
    color: var(--text-secondary);
}

/* === PAGE HEADER === */
.page-header {
    padding: var(--space-10) 0 var(--space-8);
}

.page-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.page-title em {
    color: var(--accent);
    font-style: normal;
}

.page-sub {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin-top: var(--space-2);
    line-height: 1.6;
}

/* === SECTION LABELS === */
.section-label {
    font-size: var(--text-xs);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.section-title {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-4);
}

/* === LOADING === */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-16) var(--space-6);
    gap: var(--space-4);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === METHOD BOX === */
.method-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-10);
}

.method-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.method-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.7;
}

.method-text strong {
    color: var(--text-secondary);
}

/* === GAMBLE RESPONSIBLY NOTICE === */
.gamble-notice {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border);
    margin-top: var(--space-6);
}

.gamble-notice a {
    color: var(--accent);
    margin-left: var(--space-2);
}

/* === RESPONSIVE === */

/* Tablet */
@media (max-width: 1024px) {
    .container { padding: 0 var(--space-5); }
}

/* Mobile */
@media (max-width: 640px) {
    html { font-size: var(--text-sm); }

    #site-nav .nav-links { display: none; }
    #site-nav .hamburger { display: flex; }
    #site-nav .nav-inner { padding: 0 var(--space-4); }

    .container { padding: 0 var(--space-4); }

    .page-header { padding: var(--space-6) 0 var(--space-5); }
    .page-title { font-size: var(--text-2xl); }
    .page-sub { font-size: var(--text-sm); }

    #site-footer .footer-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--space-5);
    }

    #site-footer .footer-responsible {
        align-items: center;
    }

    #site-footer .footer-nav {
        justify-content: center;
    }
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
    overflow: hidden;
}
