/* ==========================================================================
   ELITE DUAL-ROW NAVIGATION MOTOR (Full-Bleed Center-Locked Upgrade)
   ========================================================================== */

/* Main Navigation Box wrapper - Forces background to bleed edge-to-edge */
.main-nav {
    position: fixed;            /* CHANGED: Switched sticky to fixed for an unbreakable lock */
    top: 0;
    left: 0;                    /* ADDED: Pulls fixed navbar to the absolute screen left */
    z-index: 10000;             /* CHANGED: Elevated layer weight to override scrolling sections */
    background-color: rgba(11, 14, 17, 0.90);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    width: 100%;                /* CHANGED: Switched 100vw to 100% to eliminate nasty layout horizontal scrollbars */
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

/* Master Container Grid - Holds all contents inside standard desktop boundaries */
.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px; /* Desktop Standard Height */
    position: relative; /* Anchor for absolute elements */
    width: 100%;
    max-width: 1200px;  /* Locks elements onto your core content lines */
    margin: 0 auto;     /* Centers everything horizontally on wide monitors */
    padding: 0 24px;    /* Protected side buffer gutters */
    box-sizing: border-box;
}

/* Structural Alignment blocks */
.nav-top-tier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Identity Alignment Engine: Logo + Column Alignment Mechanics */
.brand-logo-group {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start;
    gap: 4px; /* Space between logo image and your dual-line text area */
}

.brand-text-column {
    display: flex;
    flex-direction: column; /* Forces subtext to drop perfectly straight under the brand name */
    justify-content: center;
    line-height: 1.1; /* Keeps line height tight and professional */
}

.nav-logo-img {
    height: 38px;      /* Slightly scaled height profile to balance the dual-line text block layout */
    width: auto;        
    display: block;
}

.brand-logo-text {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Tiny Gold Subtext Styling Hooks */
.brand-subtext {
    font-size: 8px;
    font-weight: 700;
    color: var(--accent-color); /* Automatically pulls your existing golden theme color */
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px; /* Tightly buffers the gap right below the main brand name text */
    white-space: nowrap;
}

/* Navigation Link Menu Frame (Force Center Alignment) */
.nav-sub-section {
    display: flex;
    align-items: center;
    justify-content: center; /* Centers items horizontally */
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: color 0.2s ease-in-out;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--accent-color);
}

/* Navigation Action Block Layout Engine */
.nav-actions-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px; /* Uniform horizontal gap between your preview and login blocks */
}

/* Compact button layout scaling rules for navigation bar compatibility */
.btn-nav-action {
    padding: 10px 18px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
}

/* ==========================================================================
   🖥️ DESKTOP STRUCTURAL RULE (Forced Centered Links, Floating Side Blocks)
   ========================================================================== */
@media (min-width: 993px) {
    /* Push the menu sub-section to occupy full central real estate */
    .nav-wrapper {
        justify-content: center;
    }

    .nav-top-tier {
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        pointer-events: none; /* Allows clicks to pass through to links below it */
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 24px;
        box-sizing: border-box;
    }

    /* Reactive activation for brand logo group and login button mouse clicks */
    .brand-logo-group, .nav-top-tier .btn-secondary, .nav-top-tier .nav-actions-group {
        pointer-events: auto;
        position: relative;
        z-index: 10;
    }

    /* FIXED BUG: Switched from hard-coded top: 16px to top: 50% flex alignment to stop button displacement */
    .nav-top-tier .nav-actions-group {
        position: absolute;
        right: 24px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: auto;
        z-index: 10;
    }
}

/* ==========================================================================
   📱 TABLET & SMARTPHONE CONVERSION ENGINE (Viewports under 992px)
   ========================================================================== */
@media (max-width: 992px) {
    .main-nav {
        height: auto; /* Allow header box to expand contextually */
    }

    .nav-wrapper {
        display: flex;
        flex-direction: column; /* Stack top-tier above the link sub-section */
        height: auto;
        padding: 16px 20px;
        gap: 16px;
    }

    /* Force Logo-Group and Login onto the same line, spanning 100% width */
    .nav-top-tier {
        width: 100%;
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
        pointer-events: auto;
    }

    /* Convert Menu Links into a clean centered sub-section row under the logo line */
    .nav-sub-section {
        width: 100%;
        display: flex !important;
        flex-wrap: wrap; /* Wrap links gracefully if mobile screens are thin */
        justify-content: center;
        align-items: center;
        gap: 16px; /* Balanced padding for smaller screens */
        padding-top: 12px;
        border-top: 1px solid var(--border-color); /* Separator line between top tier and links */
    }

    .nav-link {
        font-size: 12px; /* Tighter typography for mobile distribution */
    }
}

/* ==========================================================================
   🚨 CRITICAL PAGE SPACING ENGINE (Fixed-Nav Content Correction)
   ========================================================================== */
body {
    padding-top: 72px; /* Matches exact desktop nav height profile */
}

@media (max-width: 992px) {
    body {
        padding-top: 118px; /* Matches expanded mobile stacked layout height profile */
    }
}




/* ==========================================================================
   🛠️ SIDE SIDEBAR & HAMBURGER SYSTEM EXTENSION (Appended Additions)
   ========================================================================== */

/* Universal Background Overlay for dismissals */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 14, 17, 0.6); /* Color matched to your theme color base */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 9998; /* Under side menu but above everything else */
}

/* Toggle Overlay Activation */
.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Default state: Hide hamburger completely on desktop sizes */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    width: 22px;
    padding: 6px 0 2px 0;
    margin-top: 4px;
}

.hamburger-btn span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--accent-color); /* Inherits your exact theme gold */
    border-radius: 1px;
    transition: all 0.25s ease-in-out;
}

/* ==========================================================================
   📱 OVERRIDE ENGINE: Transforming the Tablet & Smartphone Layout 
   ========================================================================== */
@media (max-width: 992px) {
    /* FIX: Force mobile body spacing to lock identically to desktop heights now */
    body {
        padding-top: 72px !important; 
    }

    /* FIX: Force wrapper back to uniform layout row matching your desktop template */
    .nav-wrapper {
        flex-direction: row !important;
        height: 72px !important;
        padding: 0 24px !important;
        gap: 0 !important;
    }

    /* Activate and un-hide the hamburger menu element below the brand elements */
    .hamburger-btn {
        display: flex !important;
    }

    /* Make sure header frame matches desktop limits */
    .main-nav {
        height: 72px !important;
    }

    /* Transform the horizontal tier row into your hidden side navigation column panel */
    .nav-sub-section {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important; /* Concealed outside view frame margins */
        width: 280px !important;
        height: 100vh !important;
        background-color: rgba(11, 14, 17, 0.98) !important; /* High contrast panel blend */
        border-right: 1px solid var(--border-color) !important;
        border-top: none !important; /* Cleans original top rule dividers away */
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 40px 24px !important;
        gap: 24px !important;
        z-index: 10005 !important; /* Elevated override depth weight */
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-sizing: border-box !important;
    }

    /* Toggle Slide-Out Interaction Trigger */
    .nav-sub-section.open {
        left: 0 !important;
    }

    /* Upgrade typography scale slightly for mobile thumb targets */
    .nav-link {
        font-size: 15px !important;
        width: 100%;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    }
}
