﻿/* ================================
   NAVBAR – BASE (DESKTOP)  ✅ unchanged look
   ================================ */

/* Safe sizing inside navbar only (prevents page-to-page differences) */
.navMenu, .navMenu * {
    box-sizing: border-box;
}

.navMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 135px;
    background: rgba(248,248,255,0.92);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: flex-end;
    padding: 0 40px 10px 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    font-family: 'New Machiato', sans-serif;
    text-decoration: none;
}

.navLogoLink {
    position: absolute;
    left: 30px;
    top: 0;
}

.navLogoImg {
    width: 193px;
    height: 190px;
    object-fit: contain;
    display: block;
}

.navMenuButtons {
    display: flex;
    align-items: flex-end;
    gap: 28px;
    margin-left: 260px;
}

.navItem {
    color: #000;
    font-size: 22px;
    letter-spacing: 0.1rem;
    padding-bottom: 6px;
    line-height: 1.1; /* helps stop page-to-page line-height shifts */
    text-decoration: none !important;
}

    .navItem:hover {
        font-weight: bold;
        text-decoration: none !important;
        color: #7D85D0;
    }

.navCTA {
    color: #7D85D0;
    font-weight: bold;
}

.navAccount {
    margin-left: auto;
}

/* ================================
   Mobile Overlay Menu (<= 980px)
   Desktop is NOT changed.
   ================================ */

/* HARD default: never show burger/overlay on desktop */
.navBurger {
    display: none;
}

.navOverlay {
    display: none;
}

/* Make sure the burger button doesn't inherit weird bootstrap styles */
.navBurger,
.navClose {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    color: inherit;
}

/* Lock scroll when open */
html.nav-lock,
body.nav-lock {
    overflow: hidden;
}

@media (max-width: 980px) {

    /* Hide the horizontal link row on mobile/tablet */
    .navMenuButtons {
        display: none !important;
    }

    /* Mobile bar height */
    .navMenu {
        height: 88px;
        align-items: center;
        padding: 10px 14px;
    }

    /* Center logo */
    .navLogoLink {
        position: absolute;
        left: 50%;
        top: 6px;
        transform: translateX(-50%);
    }

    .navLogoImg {
        width: 120px;
        height: auto;
    }

    /* Show burger top-left */
    .navBurger {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        border-radius: 14px;
        border: 1px solid rgba(0,0,0,0.08);
        background: rgba(255,255,255,0.70);
        box-shadow: 0 10px 24px rgba(0,0,0,0.10);
        cursor: pointer;
        position: absolute;
        left: 12px;
        top: 18px;
        z-index: 1000; /* above navbar */
        padding: 0;
    }

    .navBurgerIcon {
        width: 20px;
        height: 2px;
        background: #2b2f52;
        position: relative;
        border-radius: 99px;
        display: block;
    }

        .navBurgerIcon::before,
        .navBurgerIcon::after {
            content: "";
            position: absolute;
            left: 0;
            width: 20px;
            height: 2px;
            background: #2b2f52;
            border-radius: 99px;
        }

        .navBurgerIcon::before {
            top: -6px;
        }

        .navBurgerIcon::after {
            top: 6px;
        }

    /* Overlay */
    .navOverlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.38);
        backdrop-filter: blur(6px);
        z-index: 2000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 160ms ease;
    }

        .navOverlay.is-open {
            opacity: 1;
            pointer-events: auto;
        }

    /* Drawer panel */
    .navDrawer {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: min(340px, 88vw);
        /* ✅ Beamy background image + soft glass overlay */
        background: linear-gradient( rgba(248,248,255,0.3), rgba(248,248,255,0.3) ), url("../../Images/registerBackground2.png") center / cover no-repeat;
        box-shadow: 20px 0 60px rgba(0,0,0,0.22);
        padding: 16px 14px;
        transform: translateX(-102%);
        transition: transform 180ms ease;
        border-right: 1px solid rgba(0,0,0,0.06);
        display: flex;
        flex-direction: column;
        gap: 14px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }


    .navOverlay.is-open .navDrawer {
        transform: translateX(0);
    }

    .navDrawerTop {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 6px 2px;
    }

    .navDrawerTitle {
        font-family: 'New Machiato', sans-serif;
        font-size: 22px; /* larger */
        letter-spacing: 0.12rem;
        font-weight: 700;
        margin-left: 4px;
        /* Beamy gradient text */
        background: linear-gradient( 120deg, #7D85D0, #9aa2e9, #d6d9f5 );
        background-size: 200% 200%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        /* polish */
        line-height: 1.2;
    }

    .navDrawerTitle {
        animation: beamyTitleFlow 8s ease infinite;
    }

    @keyframes beamyTitleFlow {
        0% {
            background-position: 0% 50%;
        }

        50% {
            background-position: 100% 50%;
        }

        100% {
            background-position: 0% 50%;
        }
    }


    .navClose {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        border: 1px solid rgba(0,0,0,0.08);
        background: rgba(255,255,255,0.75);
        cursor: pointer;
        box-shadow: 0 10px 24px rgba(0,0,0,0.10);
        padding: 0;
    }

    .navDrawerLinks {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-top: 6px;
        text-decoration: none !important;
    }

    .navDrawerItem {
        color: #7D85D0;
        font-family: 'New Machiato', sans-serif;
        font-size: 16px;
        letter-spacing: .06rem;
        padding: 12px 12px;
        border-radius: 14px;
        background: rgba(255,255,255,0.70);
        border: 1px solid rgba(0,0,0,0.06);
        box-shadow: 0 10px 22px rgba(0,0,0,0.08);
        font-weight: bold;
        text-decoration: none !important;
        position: relative;
        overflow: hidden;
        background: rgba(255,255,255,0.70);
        transition: color 220ms ease, transform 220ms ease;
    }
    
    /* Nav Drawer Background Hover */
        /* Animated Beamy gradient hover */
        .navDrawerItem::before {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient( 120deg, rgba(125,133,208,0.25), rgba(180,185,235,0.35), rgba(230,232,250,0.65), rgba(125,133,208,0.30) );
            background-size: 300% 300%;
            opacity: 0;
            transition: opacity 200ms ease;
            z-index: 0;
        }

        /* Hover state */
        .navDrawerItem:hover::before {
            opacity: 1;
            animation: beamyNavGradient 4.5s ease infinite;
        }

        /* Keep text above gradient */
        .navDrawerItem > * {
            position: relative;
            z-index: 1;
        }

        /* Optional subtle lift */
        .navDrawerItem:hover {
            transform: translateY(-1px);
        }

    /* Gradient motion */
    @keyframes beamyNavGradient {
        0% {
            background-position: 0% 50%;
        }

        50% {
            background-position: 100% 50%;
        }

        100% {
            background-position: 0% 50%;
        }
    }
    /* End Nav Drawer Background Hover */

    .navDrawerCTA {
        color: #fff;
        border-color: rgba(125,133,208,0.60);
    }

    .navDrawerHint {
        margin-top: auto;
        font-size: 12px;
        opacity: 0.75;
        color: #2b2f52;
        padding: 6px 4px;
    }
}


@media (max-width: 420px) {
    .navDrawer {
        width: min(260px, 76vw);
    }
}

@media (min-width: 421px) and (max-width: 980px) {
    .navDrawer {
        width: min(300px, 72vw);
    }
}

/* =========================================================
   MOBILE ONLY: keep WebGL under nav drawer WHEN OPEN
   Does NOT affect desktop
   ========================================================= */
@media (max-width: 980px) {

    /* While mobile nav is open */
    html.nav-lock #container3D,
    body.nav-lock #container3D {
        position: relative;
        z-index: 0;
        pointer-events: none;
    }

        html.nav-lock #container3D canvas,
        body.nav-lock #container3D canvas {
            position: relative;
            z-index: 0;
        }
}

/* =========================================================
   MOBILE ONLY: keep planes UNDER the nav when the drawer is open
   Targets your real planes container: #planesCanvasWrap
   Desktop behavior remains unchanged.
   ========================================================= */
@media (max-width: 980px) {

    /* Make sure nav layers are definitively above */
    .navMenu {
        z-index: 3000 !important;
    }

    .navBurger {
        z-index: 3500 !important;
    }

    .navOverlay {
        z-index: 4000 !important;
    }

    /* When the nav is open, force planes below and disable interaction */
    html.nav-lock #planesCanvasWrap,
    body.nav-lock #planesCanvasWrap,
    html.nav-lock #planesCanvasWrap canvas,
    body.nav-lock #planesCanvasWrap canvas {
        position: relative !important;
        z-index: 0 !important;
        pointer-events: none !important;
    }
}
