/**
 * Shared Header/Nav/Footer Styles for Oddsphere
 * ONLY includes styles that are 100% identical across all pages
 * Page-specific table layouts remain in individual files
 */

/* Design tokens — single source for the dark theme. Page styles should reach
   for these instead of minting new grays. */
:root {
    --os-bg: #2a2a2a;
    --os-bg-deep: #1a1a1a;
    --os-surface: #1f1f1f;
    --os-surface-2: #202020;
    --os-surface-raised: #343434;
    --os-border: #343434;
    --os-border-soft: #2e2e2e;
    --os-text: #f4f4f4;
    --os-text-muted: #a8a8a8;
    --os-text-faint: #8a8a8a; /* was #666 — failed WCAG AA contrast on the dark surfaces */
    --os-accent: #b8efc0;
    --os-accent-strong: #9fceaa;
    --os-accent-ink: #1a3f29;
    --os-negative: #ff9a9a;
    --os-warning: #ffd991;
    --os-discord: #5865F2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background-color: #2a2a2a;
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Growth capture */
.growth-capture {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
    gap: 22px;
    align-items: center;
    margin: 26px 0;
    padding: 20px;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    background: #202020;
}

.growth-capture-copy {
    min-width: 0;
}

.growth-capture-kicker {
    color: #b8efc0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.growth-capture h2 {
    color: #f4f4f4;
    font-size: 22px;
    line-height: 1.2;
    margin: 0 0 8px;
    letter-spacing: 0;
}

.growth-capture p {
    color: #bdbdbd;
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
}

.growth-capture-form {
    min-width: 0;
}

.growth-capture-label {
    display: block;
    color: #9a9a9a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.growth-capture-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

.growth-capture-input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #464646;
    border-radius: 8px;
    background: #171717;
    color: #f4f4f4;
    font: inherit;
    padding: 0 12px;
}

.growth-capture-input:focus {
    border-color: #b8efc0;
    outline: none;
    /* The ring is the focus indicator (outline is suppressed) — keep it
       strong enough for keyboard users to spot. */
    box-shadow: 0 0 0 3px rgba(184, 239, 192, 0.45);
}

.growth-capture-submit,
.growth-capture-discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    padding: 0 14px;
    text-decoration: none;
    white-space: nowrap;
}

.growth-capture-submit {
    background: #b8efc0;
    color: #17351f;
}

.growth-capture-submit:disabled {
    cursor: wait;
    opacity: .75;
}

.growth-capture-discord {
    background: #5865F2;
    color: #fff;
}

.growth-capture-status {
    min-height: 20px;
    padding-top: 8px;
    color: #b8efc0;
    font-size: 13px;
}

.growth-capture-status.error {
    color: #ff9a9a;
}

@media (max-width: 760px) {
    .growth-capture {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .growth-capture-row {
        grid-template-columns: 1fr;
    }
}

/* Inline result capture (revealed on a +EV calculator result) */
.result-capture {
    margin: 16px 0 4px;
    padding: 16px 18px;
    border: 1px solid #b8efc0;
    border-radius: 8px;
    background: linear-gradient(180deg, #20281f, #1b211a);
}

.result-capture.is-revealed {
    animation: result-capture-in .35s ease;
}

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

.result-capture-head {
    margin: 0 0 12px;
    color: #f4f4f4;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.result-capture-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.result-capture-input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #464646;
    border-radius: 8px;
    background: #171717;
    color: #f4f4f4;
    font: inherit;
    padding: 0 12px;
}

.result-capture-input:focus {
    border-color: #b8efc0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(184, 239, 192, 0.45);
}

.result-capture-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: #b8efc0;
    color: #17351f;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    padding: 0 16px;
    white-space: nowrap;
}

.result-capture-submit:disabled {
    cursor: wait;
    opacity: .75;
}

.result-capture-status {
    min-height: 18px;
    padding-top: 8px;
    margin: 0;
    color: #b8efc0;
    font-size: 13px;
}

.result-capture-status.error {
    color: #ff9a9a;
}

@media (max-width: 620px) {
    .result-capture-row {
        grid-template-columns: 1fr;
    }
}

/* Header Styles */
.header {
    padding: 17px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    background-color: #1f1f1f;
}

/* Hamburger Menu */
.hamburger-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Hide About in hamburger menu on desktop, show only on mobile */
.hamburger-menu-about {
    display: none;
}

.hamburger-menu-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    border-radius: 6px;
}

.hamburger-menu-toggle:hover {
    color: #b8efc0;
    background-color: rgba(184, 239, 192, 0.1);
}

.hamburger-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.hamburger-menu-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 12px);
    display: none;
    flex-direction: column;
    gap: 0;
    min-width: 200px;
    padding: 8px;
    background: #1f1f1f;
    border: 1px solid #323232;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    z-index: 100;
}

.hamburger-menu-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 24px;
    width: 16px;
    height: 16px;
    background: #1f1f1f;
    border-top: 1px solid #323232;
    border-left: 1px solid #323232;
    transform: rotate(45deg);
}

.hamburger-menu-container.open .hamburger-menu-dropdown {
    display: flex;
}

.hamburger-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.hamburger-menu-link:hover {
    background-color: #2a2a2a;
    color: #b8efc0;
}

.hamburger-menu-link.active {
    background-color: rgba(184, 239, 192, 0.1);
    color: #b8efc0;
}

.hamburger-menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Primary-nav mirror inside the hamburger — mobile only (the inline .nav-menu
   overflowed narrow screens, so below 768px the hamburger IS the nav). */
.hamburger-mobile-nav {
    display: none;
}

.hamburger-menu-divider {
    height: 1px;
    background: var(--os-border);
    margin: 6px 8px;
}

/* Header Separator */
.header-separator {
    width: 1px;
    height: 32px;
    background-color: #444;
    margin: 0 2px 0 4px;
}

/* Desktop (inline .nav-menu visible): the hamburger only duplicated it —
   every dropdown destination has an inline home (calculators under Tools,
   Results and Affiliates as nav links). Below 769px the hamburger IS the
   nav and stays. The separator only divided hamburger from logo, so it
   goes with it. */
@media (min-width: 769px) {
    .hamburger-menu-container { display: none; }
    .header-separator { display: none; }
}

.logo {
    height: 32px;
    width: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.site-title {
    font-size: 24px;
    font-weight: 600;
    color: white;
    letter-spacing: -0.02em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 0.9;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Navigation Styles */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #b8efc0;
}

.nav-link.active {
    color: #b8efc0;
}

.nav-dropdown {
    position: relative;
    padding-bottom: 18px;
    margin-bottom: -18px;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 0;
}

.nav-dropdown.active > .nav-dropdown-toggle,
.nav-dropdown-toggle:hover {
    color: #b8efc0;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% - 6px);
    left: 0;
    background: #262626;
    border: 1px solid #343434;
    border-radius: 10px;
    padding: 10px 0;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    display: none;
    flex-direction: column;
    z-index: 10;
}

.nav-dropdown.open > .nav-dropdown-menu,
.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown:focus-within > .nav-dropdown-menu {
    display: flex;
}

.nav-dropdown-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-dropdown-link:hover {
    background-color: #343434;
    color: #b8efc0;
}

.nav-dropdown-link.active {
    color: #b8efc0;
    background-color: #2f3b30;
}

.nav-caret {
    width: 10px;
    height: 10px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-caret {
    transform: rotate(180deg);
}

/* Header Action Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 16px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.discord-btn {
    background-color: #5865F2;
}

.discord-btn:hover {
    background-color: #4752C4;
}

.upgrade-btn {
    display: none !important;
}

.signin-btn {
    background-color: #b8efc0;
    color: #1f1f1f;
    border: none;
    cursor: pointer;
}

.signin-btn:hover {
    background-color: #9fceaa;
}

/* Sign In Dropdown */
.signin-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.signin-caret {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.signin-dropdown.open .signin-caret {
    transform: rotate(180deg);
}

.signin-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    display: none;
    flex-direction: column;
    gap: 0;
    min-width: 240px;
    padding: 8px;
    background: #1f1f1f;
    border: 1px solid #323232;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    z-index: 100;
}

.signin-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 24px;
    width: 16px;
    height: 16px;
    background: #1f1f1f;
    border-top: 1px solid #323232;
    border-left: 1px solid #323232;
    transform: rotate(45deg);
}

.signin-dropdown.open .signin-dropdown-menu {
    display: flex;
}

.signin-dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.signin-dropdown-link:hover {
    background-color: #2a2a2a;
}

.signin-dropdown-divider {
    height: 1px;
    background: #343434;
    margin: 4px 8px;
}

.oddsphere-plus-link {
    background-color: rgba(184, 239, 192, 0.1);
    color: #b8efc0;
    font-weight: 600;
}

.oddsphere-plus-link:hover {
    background-color: rgba(184, 239, 192, 0.2);
    color: #b8efc0;
}

.signin-provider-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.profile-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Profile/User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #444;
    background-color: #333;
}

.profile-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    border: 1px solid #343434;
    background: #262626;
    cursor: pointer;
    color: inherit;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.profile-toggle:hover {
    border-color: #4c4c4c;
    background: #2f2f2f;
}

.profile-toggle:focus-visible {
    outline: 2px solid #5865F2;
    outline-offset: 2px;
}

.profile-caret {
    width: 12px;
    height: 12px;
    fill: #b8efc0;
    transition: transform 0.2s ease;
}

.profile-dropdown.open .profile-caret {
    transform: rotate(180deg);
}

.profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
    padding: 18px 18px 16px;
    background: #1f1f1f;
    border: 1px solid #323232;
    border-radius: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    z-index: 100;
}

.profile-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 24px;
    width: 16px;
    height: 16px;
    background: #1f1f1f;
    border-top: 1px solid #323232;
    border-left: 1px solid #323232;
    transform: rotate(45deg);
}

.profile-dropdown.open .profile-menu {
    display: flex;
}

.profile-username {
    font-size: 14px;
    color: #a9a9a9;
    line-height: 1.4;
    margin-bottom: 8px;
}

.profile-username strong {
    display: block;
    margin-top: 2px;
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    background: #2a2a2a;
    color: #b8efc0;
    transition: background-color 0.2s ease;
}

.profile-link:hover {
    background: #333;
}

.profile-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    background: #3a3a3a;
    color: #ff6b6b;
    transition: background-color 0.2s ease;
}

.profile-logout:hover {
    background: #444;
    color: #ff8787;
}

.btn-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Footer Styles */
.footer {
    background-color: #1a1a1a;
    color: #9a9a9a;
    padding: 48px 20px 24px;
    font-size: 13px;
    border-top: 1px solid #333;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 40px;
    text-align: left;
    padding-bottom: 32px;
    border-bottom: 1px solid #2e2e2e;
}

.footer-brand-name {
    display: inline-block;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.footer-tagline {
    color: #9a9a9a;
    line-height: 1.6;
    max-width: 280px;
    margin: 0 0 16px;
}

.footer-discord {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(88, 101, 242, 0.15);
    color: #aab4ff;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.footer-discord:hover {
    background: rgba(88, 101, 242, 0.3);
    color: #ffffff;
}

.footer-discord-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a8a8a;
    margin-bottom: 4px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.footer-link {
    color: #9aa39b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #b8efc0;
}

.footer-email {
    color: #b8efc0;
    text-decoration: none;
}

.footer-email:hover {
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
}

.footer-copyright {
    margin-bottom: 10px;
}

.footer-responsible {
    font-size: 11px;
    color: #8a8a8a;
    margin-top: 15px;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

/* Mobile Responsive - Header/Nav/Footer Only */
@media (max-width: 768px) {
    .signin-text {
        display: none;
    }

    /* The inline nav overflowed narrow viewports (Tools/About spilled past the
       account pill). On mobile the header is hamburger + logo + account only;
       all destinations live in the hamburger menu. */
    .nav-menu {
        display: none !important;
    }

    .header-separator {
        display: none;
    }

    .hamburger-mobile-nav {
        display: flex;
        flex-direction: column;
    }

    .hamburger-menu-dropdown {
        min-width: 240px;
        max-height: calc(100vh - 90px);
        overflow-y: auto;
    }

    .hamburger-menu-about {
        display: flex !important;
    }

    .upgrade-btn,
    .discord-btn {
        display: none !important;
    }

    .header {
        padding: 14px 16px;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .logo {
        height: 28px;
        width: 28px;
        flex-shrink: 0;
    }

    .header-left {
        gap: 10px;
        flex: 1;
        min-width: 0;
    }

    .header-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    .header-btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
    }

    .profile-toggle {
        padding-right: 8px;
        gap: 8px;
    }

    .footer {
        font-size: 12px;
    }

    .footer-links {
        gap: 15px;
    }
}

/* Sport toggle (stats/rankings pages) */
.sport-toggle {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.sport-toggle-btn {
    padding: 8px 22px;
    border-radius: 999px;
    background: #383838;
    color: #cfcfcf;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sport-toggle-btn:hover {
    background: #444;
    color: #fff;
}

.sport-toggle-btn.active {
    background: #b8efc0;
    color: #1a3f29;
}

.sport-toggle-note {
    align-self: center;
    font-size: 12px;
    color: #8a8a8a;
}

/* Designed empty state (off-season / no data) */
.empty-state-panel {
    max-width: 560px;
    margin: 48px auto;
    padding: 36px 32px;
    text-align: center;
    background: #1f1f1f;
    border: 1px solid #343434;
    border-radius: 14px;
}

.empty-state-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}

.empty-state-body {
    color: #a8b0a9;
    line-height: 1.6;
    margin-bottom: 24px;
}

.empty-state-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.empty-state-btn {
    display: inline-flex;
    align-items: center;
    padding: 11px 22px;
    border-radius: 9px;
    background: #343434;
    color: #e8e8e8;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.empty-state-btn:hover {
    background: #3e3e3e;
    transform: translateY(-1px);
}

.empty-state-btn-primary {
    background: #b8efc0;
    color: #1a3f29;
}

.empty-state-btn-primary:hover {
    background: #cdf5d3;
}

.nav-offseason {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a8a8a;
    background: #333;
    border-radius: 999px;
    padding: 2px 8px;
    margin-left: 6px;
    vertical-align: middle;
}


/* Numbers in data tables align vertically */
table, .rankings-table, .results-table, .preview-table, .stats-table {
    font-variant-numeric: tabular-nums;
}

/* Soft mint glow behind page headers — carries the hero atmosphere inward */
.page-header {
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -40px;
    transform: translateX(-50%);
    width: min(560px, 90vw);
    height: 160px;
    background: radial-gradient(ellipse at center, rgba(184, 239, 192, 0.07) 0%, rgba(184, 239, 192, 0) 70%);
    pointer-events: none;
}

/* Typography: tighter display headings site-wide */
h1, h2 {
    letter-spacing: -0.02em;
}

/* Consistent card elevation on data tables */
.rankings-table, .stats-table, .table-wrap {
    border: 1px solid rgba(255, 255, 255, 0.06);
}
