/* ========== BASE STYLES ========== */

body {
    margin: 0;
    padding: 0;
    background: #000;
    font-family: Arial, sans-serif;
}

/* Main nav container */
.navbar-container {
    background: #111;
    width: 100%;
    overflow: visible;
    display: flow-root;
}

/* Logo */
.navbar-logo {
    float: left;
    padding: 5px 10px;
}

.navbar-logo img {
    height: 36px;
    width: auto;
    vertical-align: middle;
}

/* Mobile toggle - hidden on desktop */
.nav-mobile-toggle {
    display: none;
    float: right;
    color: #fff;
    font-size: 24px;
    padding: 10px 16px;
    cursor: pointer;
    line-height: 36px;
}


/* ========== MAIN NAV LIST ========== */

.nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-block;
    vertical-align: top;
    margin-top: 6px;
}

/* All nav links */
.nav a {
    display: block;
    background: #111;
    color: #fff;
    text-decoration: none;
    padding: 0.8em 1.2em;
    text-transform: uppercase;
    font-size: 75%;
    letter-spacing: 1px;
    text-shadow: 0 -1px 0 #000;
    position: relative;
    white-space: nowrap;
}

/* All <li> become positioning anchors for dropdowns */
.nav li {
    position: relative;
}


/* ========== TOP-LEVEL TABS ========== */

.nav > li {
    float: left;
    border-bottom: 0px #aaa solid;      /* Bottom rail removed */
    border-top: 4px #aaa solid;         /* Gray rail moved ABOVE the tabs */
    margin-right: 1px;
    padding: 0;
    position: relative;
}

/* Subtle 3D bevel on top-level links */
.nav > li > a {
    margin-bottom: 1px;
    box-shadow: inset 0 2em .33em -.5em #555;
}

/* Hover: gray rail turns orange */
.nav > li:hover,
.nav > li:hover > a {
    border-top-color: orange;
}

/* Hover: link text turns orange */
.nav li:hover > a {
    color: orange;
}

/* First tab - rounded top-left */
.nav > li:first-child {
    border-radius: 4px 0 0 4px;
}

.nav > li:first-child > a {
    border-radius: 4px 0 0 0;
}

/* Last tab - rounded top-right */
.nav > li:last-child {
    border-radius: 0 4px 4px 0;
    margin-right: 0;
}

.nav > li:last-child > a {
    border-radius: 0 4px 0 0;
}

/* Small gap between stacked submenu links */
.nav li li a {
    margin-top: 1px;
}


/* ========== DROPDOWN POSITIONING ========== */

/* All dropdown <ul> - hidden by default, sits at the bottom of the parent <li> */
.nav ul {
    position: absolute;
    white-space: nowrap;
    border-bottom: 5px solid orange;    /* Orange accent line at bottom of dropdown */
    z-index: 9999;                      /* Sits above all other page content */
    padding: 0;
    list-style: none;
    margin: 0;
    background: #111;
    top: 100%;                          /* Fallback positioning */
    left: 0;
    visibility: hidden;                 /* Hidden until hover */
    opacity: 0;                         /* Fully transparent when hidden */
    transition: visibility 0s 0.5s, opacity 0s 0.1s;  /* 0.5s delay before hiding — gives user time to re-hover */
}

/* Show first-level dropdown on hover — instant, no delay */
.nav > li:hover > ul {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: visibility 0s 0s, opacity 0s 0s !important;  /* Instant show */
    min-width: 100% !important;
    top: 32px !important;               /* Adjust this value to position below the gray rail */
    left: 0 !important;
}

/* Nested flyout submenus - white left border */
.nav > li li ul {
    border-left: 1px solid #fff;
}

/* Flyout opens to the RIGHT of its parent */
.nav > li li:hover > ul {
    left: 100%;
    top: -1px;
}


/* ========== LAYOUT: LEFT & RIGHT NAV GROUPS ========== */

.nav-left {
    float: left;
    margin-left: 10px;
}

.nav-right {
    float: right;
    margin-right: 10px;
}


/* ========== MOBILE NAV ========== */

.nav-mobile {
    display: none;
    clear: both;
    background: #111;
    width: 100%;
}

.nav-mobile a {
    display: block;
    color: #fff;
    padding: 10px 16px;
    text-decoration: none;
    border-bottom: 1px solid #333;
}

.nav-mobile hr {
    margin: 5px 0;
    border-color: #444;
}

.nav-mobile span {
    display: block;
    padding: 8px 16px;
    color: #fff;
}

.nav-mobile.show {
    display: block;
}


/* ========== RESPONSIVE BREAKPOINT ========== */

@media screen and (max-width: 900px) {
    .nav-left,
    .nav-right {
        display: none;
    }
    .nav-mobile-toggle {
        display: block;
    }
}


/* ========== CARETS (ARROW INDICATORS) ========== */

/* Down caret on top-level tabs that have a dropdown */
.nav > li:has(> ul) > a::after {
    content: " ▾";
    font-size: 70%;
    vertical-align: middle;
}

/* Right caret on submenu items that have nested flyouts */
.nav li li:has(> ul) > a::after {
    content: " ▸";
    font-size: 70%;
    vertical-align: middle;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* Left caret when flyout opens to the left */
.nav li li.flyout-left:has(> ul) > a::after {
    content: " ◂";
    right: auto;
    left: 8px;
}

/* Extra padding so caret doesn't overlap text */
.nav li li:has(> ul) > a {
    padding-right: 28px;
}

.nav li li.flyout-left:has(> ul) > a {
    padding-right: 1.2em;
    padding-left: 28px;
}


/* ========== SMART FLYOUT (EDGE DETECTION) ========== */

/* When JS adds .flyout-left, flyout opens to the LEFT instead of right */
.nav li li.flyout-left > ul {
    left: auto;
    right: 100%;
    border-left: none;
    border-right: 1px solid #fff;
}