/* ============================================
   Site chrome: header + footer styles.
   Extracted from free-header.js / footer.js so the markup can be
   server-rendered (templates/partials/free_header.html, footer.html).
   The JS files keep a copy embedded for their legacy-injection fallback
   (external WordPress pages) — keep both in sync until that's gone.
   ============================================ */

/* === Header === */
.header {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 9999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
    font-family: 'DM Sans', sans-serif;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-logo {
    height: 60px;
    width: auto;
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-item {
    position: relative;
    color: #E8E6E3;
    cursor: pointer;
    padding: 10px 0;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.02em;
    transition: color 0.3s ease, background-color 0.3s ease;
    z-index: 10001;
}

/* Top-level menu opener — a real <button> so it's keyboard-focusable and
   announced as an expandable control (aria-expanded) to screen readers */
.nav-trigger {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    border-radius: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

/* Override the global `button`/`button:hover` gradient in v2-styles.css —
   these are plain text triggers, not pill buttons */
.nav-trigger:hover,
.nav-trigger:focus {
    background: none;
    transform: none;
    box-shadow: none;
}

.nav-trigger:focus-visible {
    outline: 2px solid #00E676;
    outline-offset: 4px;
    border-radius: 4px;
}

.nav-item.active {
    color: #00E676;
}

/* "You are here" — set by free-header.js on the menu owning the current page */
.nav-item.current {
    color: #00E676;
}
.nav-item.current::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 2px;
    background: #00E676;
    border-radius: 2px;
}

.nav-item:hover > .dropdown,
.nav-item.active > .dropdown {
    display: block;
}

/* Scoped to .nav-menu: bare .dropdown collides with the odds-table row menus
   (.menu-button-container .dropdown) and header.js mega-menu on app pages */
.nav-menu .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    white-space: nowrap;
    /* Size the box to its widest link. The menu-item is a narrow containing block,
       so without this the box shrink-fits too small and overflow-y:auto clips the links */
    width: max-content;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 0;
    z-index: 10000 !important;
    /* Long menus (Stats Trackers, Sportsbooks) must stay reachable on short laptops */
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.nav-menu .dropdown a {
    color: #E8E6E3;
    padding: 8px 12px;
    margin: 2px 6px;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    border-radius: 6px;
}

.nav-menu .dropdown a:hover {
    background-color: #1A1A26;
    color: #00E676;
    transform: translateX(3px);
}

.nav-menu .dropdown a[aria-current="page"] {
    background-color: #1A1A26;
    color: #00E676;
    font-weight: 700;
}

/* Sportsbooks menu is 19 items — lay it out as a 2-column mega-menu on desktop,
   anchored to the right edge (it's the rightmost menu) so it can't clip offscreen */
#menu-books {
    grid-template-columns: repeat(2, max-content);
    column-gap: 8px;
    left: auto;
    right: 0;
}

/* Switch to 2 columns only while OPEN, and only on desktop — so the normal
   display:none/block hover toggle still hides it. (Setting display:grid on the
   #id unconditionally outranks the base display:none and pins the menu open.) */
@media (min-width: 1025px) {
    .nav-item:hover > #menu-books,
    .nav-item.active > #menu-books {
        display: grid;
    }
}

.nav-menu .dropdown-separator {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #2A2A3A, transparent);
    margin: 8px 0;
    opacity: 0.6;
}

.nav-menu .dropdown-separator-label {
    text-align: center;
    padding: 8px 16px;
    font-size: 12px;
    color: #9C9CAD;
    font-family: 'DM Sans', sans-serif;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    color: #E8E6E3;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.cta-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.cta-button {
    background: linear-gradient(135deg, #00E676, #00BFA5);
    color: #0A0A0F;
    border: none;
    padding: 10px 20px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 230, 118, 0.3);
}

.login-link {
    color: #9C9CAD;
    text-decoration: none;
    border-bottom: 1px solid rgba(138, 138, 154, 0.3);
    cursor: pointer;
    white-space: nowrap;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.login-link:hover {
    color: #E8E6E3;
    border-bottom-color: #E8E6E3;
}

@media (max-width: 1024px) {
    .header-content {
        padding: 0 10px;
        gap: 10px;
    }

    .mobile-menu-button {
        display: block;
        flex-shrink: 0;
    }

    .header-logo {
        height: 50px;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 87px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        height: calc(100vh - 87px);
        overflow-y: auto;
        z-index: 9999;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }

    .nav-menu.active {
        display: flex !important;
        height: calc(100vh - 90px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 150px;
    }

    .nav-item {
        width: 100%;
        padding: 0;
        border-bottom: 1px solid #2A2A3A;
    }

    .nav-trigger {
        display: block;
        width: 100%;
        text-align: left;
        padding: 15px;
    }

    .nav-item.active {
        background-color: #1A1A26;
        color: #00E676;
    }

    .nav-menu .dropdown {
        position: static;
        width: 100%;
        margin-top: 10px;
        background: rgba(26, 26, 38, 0.9);
        padding: 15px 0;
    }

    /* Single column on mobile — the desktop 2-col rule is gated to min-width:1025px,
       so here it just falls back to the normal full-width dropdown */
    #menu-books {
        width: 100%;
        right: auto;
    }

    .nav-item:last-child {
        margin-bottom: 200px;
    }

    .nav-item.active:last-child {
        margin-bottom: 250px;
    }

    .cta-container {
        gap: 5px;
    }

    .cta-button {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
        max-width: 140px;
    }

    .login-link {
        font-size: 14px;
    }
}

.is-homepage .header-logo-container {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.is-homepage.show-logo .header-logo-container {
    opacity: 1;
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.nav-menu.active {
    display: flex !important;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* === Footer === */
html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

#page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Override styles.css page-wrapper padding for footer section */
#page-wrapper > .footer {
    margin-left: -40px;  /* Compensate for page-wrapper padding-left */
    margin-right: -20px; /* Compensate for page-wrapper padding-right */
    width: calc(100% + 60px); /* Full width accounting for padding */
}

main {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #E8E6E3;
    font-family: 'DM Sans', sans-serif;
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: left;
    box-sizing: border-box;
}

.footer-section {
    padding: 10px;
    text-align: left;
}

.footer-section h3 {
    color: #00E676;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #9C9CAD;
    text-decoration: none;
    display: block;
    padding: 4px 0;
    transition: all 0.2s ease-in-out;
}

.footer-section a:hover {
    color: #00E676;
    transform: translateX(3px);
}

.footer-logo {
    max-width: 150px;
    margin-bottom: 20px;
}

.social-icons-wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icons a {
    color: #9C9CAD;
    font-size: 24px;
    padding: 5px;
    margin: 0 10px;
    display: inline-block;
    text-decoration: none;
    background-color: transparent !important;
    transition: all 0.2s ease-in-out;
}

.social-icons a:hover {
    color: #00E676;
    transform: scale(1.2);
}

.social-icons i {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
}

.footer-brand-section {
    display: flex;
    flex-direction: column;
}

.footer-description {
    margin: 15px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #9C9CAD;
    font-family: 'DM Sans', sans-serif;
}

/* Legal Bar */
.footer-legal {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 15px 20px 0;
    border-top: 1px solid #2A2A3A;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-sizing: border-box;
}

.footer-legal-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-legal-links a {
    color: #9C9CAD;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s ease;
}

.footer-legal-links a:hover {
    color: #00E676;
}

.footer-copyright {
    color: #9C9CAD;
    font-size: 12px;
}

/* Media Queries */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 20px 0;
    }

    /* Override page-wrapper padding on mobile */
    #page-wrapper > .footer {
        margin-left: -10px;  /* Compensate for mobile page-wrapper padding */
        margin-right: -10px;
        width: calc(100% + 20px);
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 20px !important;
        max-width: 100% !important;
    }

    .footer-section {
        padding: 5px !important;
        text-align: left !important;
        width: 100% !important;
    }

    .footer-brand-section {
        align-items: flex-start !important;
        text-align: left !important;
        width: 100% !important;
    }

    .social-icons-wrapper {
        justify-content: flex-start !important;
        width: 100% !important;
    }

    .social-icons {
        display: flex !important;
        gap: 15px !important;
        margin: 15px 0 !important;
    }

    .social-icons a {
        margin: 0 !important;
        padding: 0 !important;
    }

    .footer-legal {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px 0;
    }

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