/**
 * Aurevya Main Menu Styles
 *
 * Adapted from lodh-templates2c40.css for the leftnavbar flyout menu
 * with 3-level hierarchy support and animations.
 *
 * Animation Classes:
 * - .-active: Element is visible/shown
 * - .-opening: Element is animating open (with -active)
 * - .-closing: Element is animating closed
 * - .-oneactive: Parent ul has one child submenu active
 *
 * Z-Index Layering:
 * - Header: 10000 (always on top)
 * - Leftnavbar: 9999
 * - Leftsubnavbar: 50 (relative to leftnavbar)
 * - Menu Overlay: 9997
 *
 * @package Aurevya_Child_Theme
 */

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */

:root {
    --aurevya-menu-bg: #130429;
    --aurevya-menu-width: 300px;
    --aurevya-menu-text: #fff;
    --aurevya-gold: #b59533;
    --aurevya-header-height: 80px;
    --aurevya-header-height-small: 60px;
    --aurevya-transition-speed: 0.5s;
}

/* ==========================================================================
   Z-INDEX LAYERING - Header must always be on top
   ========================================================================== */

.fusion-header-wrapper,
.fusion-header {
    position: relative;
    z-index: 10000 !important;
}

/* ==========================================================================
   LEFT NAVBAR - Main Menu Container
   Slides in from left using margin-left animation
   ========================================================================== */

.leftnavbar,
.leftsubnavbar {
    padding-top: 80px;
    top: 0;
    transition: all var(--aurevya-transition-speed) ease-in-out, padding 0.3s linear;
    width: var(--aurevya-menu-width);
}

.leftnavbar {
    background-color: var(--aurevya-menu-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 5px 0 10px 0 rgba(0, 0, 0, 0.3);
    font-size: 1rem;
    height: calc(100vh - var(--aurevya-header-height));
    margin-left: calc(var(--aurevya-menu-width) * -1); /* Hidden: slides off-screen left */
    padding-top: 0;
    position: fixed;
    left: 0;
    top: var(--aurevya-header-height);
    transition: all var(--aurevya-transition-speed) ease-in-out, top 0.3s linear, height 0.3s linear;
    z-index: 9999;
}

/* Small header state */
.-small .leftnavbar {
    height: calc(100vh - var(--aurevya-header-height-small));
    top: var(--aurevya-header-height-small);
}

.-small .leftsubnavbar {
    top: var(--aurevya-header-height-small);
}

/* Active state - slide in */
.leftnavbar.-active {
    margin-left: 0 !important;
}

/* Closing animation state */
.leftnavbar.-closing {
    margin-left: calc(var(--aurevya-menu-width) * -1);
}

/* Navigation inside leftnavbar */
.leftnavbar nav {
    max-height: 100%;
    overflow: auto;
    padding: 15px 20px;
}

.leftnavbar nav ul {
    margin-bottom: 0;
    padding: 15px 0;
}

.leftnavbar nav li {
    list-style-type: none;
}

.leftnavbar nav li a {
    position: relative;
}

/* ==========================================================================
   HOVER EFFECTS - Opacity dimming on non-hovered items
   ========================================================================== */

.leftnavbar ul:hover > li:not(:hover) > a,
.leftnavbar ul:hover > li:not(:hover) > span > * {
    opacity: 0.35;
}

.leftnavbar ul:hover > li:hover > a,
.leftnavbar ul:hover > li:hover > span > a:hover {
    opacity: 1;
}

.leftnavbar ul:hover > li:hover > span > a:hover + .arrow {
    opacity: 0.35;
}

.leftnavbar ul:hover > li:hover > span > a:not(:hover) {
    opacity: 0.85;
}

/* Active submenu state - dim other items */
.leftnavbar ul.-oneactive > li:not(.-active) > span > * {
    opacity: 0.35;
}

.leftnavbar ul.-oneactive > li.-active > span > * {
    opacity: 1 !important;
}

/* Arrow rotation when submenu is active */
.leftnavbar ul.-oneactive > li.-active > span .arrow {
    transform: translateY(-50%) translateX(25px) rotate(180deg);
}

.leftnavbar ul.-oneactive > li > a {
    opacity: 0.35;
}

/* Active submenu - show the leftsubnavbar */
.leftnavbar ul li.-active > .leftsubnavbar-container > .leftsubnavbar {
    box-shadow: inset 5px 0 10px 0 rgba(0, 0, 0, 0.3), 2px 0 5px 0 rgba(0, 0, 0, 0.3);
    margin-left: 0;
}

/* Spaced items */
.leftnavbar ul li.spaced {
    margin-top: 39px;
}

/* Current/active page indicator */
.leftnavbar ul li:has(.current) > .linknav {
    font-weight: 700;
}

/* Menu bottom icon */
.leftnavbar:has(.icon) {
    padding-bottom: 130px;
}

.leftnavbar .icon,
.leftnavbar .aurevya-menu-icon {
    bottom: 0;
    height: 130px;
    left: 0;
    padding: 15px;
    position: absolute;
    right: 0;
    text-align: center;
}

.leftnavbar .icon img,
.leftnavbar .aurevya-menu-icon img {
    max-height: 100px;
    max-width: 50px;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
}

/* ==========================================================================
   LEFTSUBNAVBAR-CONTAINER - Submenu wrapper
   Positioned at left: 300px (next to main menu)
   ========================================================================== */

.leftsubnavbar-container {
    height: 100vh;
    left: var(--aurevya-menu-width); /* Position next to main menu */
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    top: 0;
    transition: all var(--aurevya-transition-speed) ease-in-out;
    z-index: 50;
    /* Width is controlled by the leftsubnavbar child sliding in/out */
}

/* Nested containers for deeper levels */
.leftsubnavbar-container .leftsubnavbar-container {
    left: calc(var(--aurevya-menu-width) * 2); /* 600px */
}

.leftsubnavbar-container .leftsubnavbar-container .leftsubnavbar-container {
    left: calc(var(--aurevya-menu-width) * 3); /* 900px */
}

/* Return/Back button - hidden on desktop */
.leftsubnavbar-container .returnbtn {
    align-items: center;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), var(--aurevya-menu-bg);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: none;
    height: 50px;
    padding-left: 52px;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.leftsubnavbar-container .returnbtn .icon {
    font-size: 35px;
    height: 35px;
    left: 14px;
    padding: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
}

.leftsubnavbar-container .returnbtn .icon-arrow_left::before {
    content: '←';
    color: rgba(255, 255, 255, 0.9);
}

.leftsubnavbar-container .returnbtn a {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
    padding: 16px;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.leftsubnavbar-container .returnbtn a:focus {
    color: #fff;
}

/* ==========================================================================
   LEFTSUBNAVBAR - Actual submenu list
   Slides in using margin-left animation
   ========================================================================== */

.leftsubnavbar {
    background-color: var(--aurevya-menu-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    bottom: 0;
    box-shadow: inset 5px 0 10px 0 rgba(0, 0, 0, 0.3);
    left: 0;
    margin-left: calc(var(--aurevya-menu-width) * -1); /* Hidden: slides off-screen left */
    overflow-y: auto;
    padding: 20px;
    padding-top: var(--aurevya-header-height);
    pointer-events: auto;
    position: absolute;
    top: 0;
    transition: all var(--aurevya-transition-speed) ease-in-out, top 0.3s linear;
    width: var(--aurevya-menu-width);
    list-style: none;
}

.leftsubnavbar li {
    list-style: none;
    margin-bottom: 5px;
}

.leftsubnavbar .linknav {
    color: var(--aurevya-menu-text);
    display: block;
    font-size: 0.95rem;
    padding: 8px 0;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.leftsubnavbar .linknav:hover {
    color: var(--aurevya-gold);
}

/* ==========================================================================
   SUBMENU ANIMATION STATES
   -opening: animating open
   -active: fully open
   -closing: animating closed
   ========================================================================== */

/* When li is active/opening, make the container visible */
li.-active > .leftsubnavbar-container,
li.-opening > .leftsubnavbar-container {
    pointer-events: auto;
    overflow: visible;
}

/* Opening animation - submenu sliding in */
li.-opening > .leftsubnavbar-container > .leftsubnavbar,
li.-active > .leftsubnavbar-container > .leftsubnavbar {
    margin-left: 0;
    box-shadow: inset 5px 0 10px 0 rgba(0, 0, 0, 0.3), 2px 0 5px 0 rgba(0, 0, 0, 0.3);
}

/* Closing animation - submenu sliding out */
li.-closing > .leftsubnavbar-container > .leftsubnavbar {
    margin-left: calc(var(--aurevya-menu-width) * -1);
}

/* ==========================================================================
   LISTFIRSTLEVEL - Top Level Menu Items
   ========================================================================== */

.listfirstlevel {
    list-style: none;
    margin: 0;
    padding: 0 !important;
}

.listfirstlevel > li {
    margin-bottom: 5px;
    position: relative;
}

/* Arrow icon for items with submenus */
.listfirstlevel li > span > .arrow {
    background-position: 100%;
    background-repeat: no-repeat;
    background-size: contain;
    height: 16px;
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease-in-out;
    width: 25px;
}

/* SVG chevron arrow */
.arrow.svg-chevron-right {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Link styles */
.listfirstlevel .linknav {
    color: var(--aurevya-menu-text);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.listfirstlevel .linknav:hover {
    color: var(--aurevya-gold);
}

.listfirstlevel span.linknav > a {
    display: inline;
    padding: 10px 0;
    transition: all 0.3s ease-in-out;
}

/* Inline sub-menu items (indented children without slide-out) */
.listfirstlevel .sub-menu-inline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.listfirstlevel .sub-menu-inline > li {
    margin-left: 25px;
}

/* ==========================================================================
   LINKNAVSUBMENU - Parent items with children (expandable)
   ========================================================================== */

.linknavsubmenu {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-right: 35px;
}

.linknavsubmenu .linknav {
    flex: 1;
    display: inline;
}

/* ==========================================================================
   MENU OVERLAY - Covers page content only
   ========================================================================== */

.aurevya-menu-overlay {
    position: fixed;
    top: var(--aurevya-header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--aurevya-header-height));
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--aurevya-transition-speed) ease, visibility var(--aurevya-transition-speed) ease;
    pointer-events: none;
}

.aurevya-menu-overlay.-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.-small .aurevya-menu-overlay {
    top: var(--aurevya-header-height-small);
    height: calc(100vh - var(--aurevya-header-height-small));
}

/* ==========================================================================
   NAVBAR TOGGLE - Menu Button (Hamburger)
   ========================================================================== */

.navbar-toggle.menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 50px;
    min-height: 50px;
}

.navbar-toggle .icon-bar {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--header_text_color, #fff);
    transition: all 0.3s ease-in-out;
}

.navbar-toggle .icon-bar + .icon-bar {
    margin-top: 5px;
}

.navbar-toggle .text-menu {
    font-size: 9px;
    color: var(--header_text_color, #fff);
    text-transform: uppercase;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* Active state - X icon transformation */
.navbar-toggle.-active .icon-bar.top-bar {
    transform: rotate(45deg);
    position: relative;
    top: 7px;
}

.navbar-toggle.-active .icon-bar.middle-bar {
    opacity: 0;
}

.navbar-toggle.-active .icon-bar.bottom-bar {
    transform: rotate(-45deg);
    position: relative;
    top: -7px;
}

/* ==========================================================================
   LARGESCREEN BUTTON - Hidden (we use header button)
   ========================================================================== */

.largescreen-button {
    display: none;
}

/* ==========================================================================
   LO-SCROLLBAR - Custom Scrollbar
   ========================================================================== */

.lo-scrollbar {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.lo-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.lo-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.lo-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.lo-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   RESPONSIVE - Mobile styles (depth-3 menu)
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --aurevya-menu-width: 100%;
        --aurevya-header-height: 70px;
    }

    .leftnavbar nav {
        height: 100vh;
    }

    .leftnavbar {
        border-left: none;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        height: calc(100vh - 70px);
        margin-left: -100vw;
        top: 70px;
        width: 100%;
    }

    .leftnavbar .linknav {
        padding-bottom: 7px;
        padding-top: 7px;
    }

    .leftnavbar ul li.-active > .leftsubnavbar-container {
        margin-right: 0;
    }

    .leftnavbar:has(.icon) {
        padding-bottom: 0;
    }

    .leftnavbar .icon,
    .leftnavbar .aurevya-menu-icon {
        height: auto;
        padding: 30px 0;
        position: static;
    }

    .leftnavbar .icon img,
    .leftnavbar .aurevya-menu-icon img {
        max-height: 70px;
        max-width: 40px;
        position: static;
        transform: none;
    }

    /* Submenu container - slides from right on mobile */
    .leftsubnavbar-container {
        left: auto !important;
        margin-right: -100vw;
        margin-top: 71px;
        right: 0;
        transition: all var(--aurevya-transition-speed) ease-in-out;
        width: 100%;
        z-index: 10;
    }

    /* Show return button on mobile */
    .leftsubnavbar-container .returnbtn {
        display: flex;
    }

    .leftsubnavbar {
        border-top: none;
        height: calc(100vh - 121px);
        margin-left: 0 !important;
        top: 50px;
        width: 100%;
    }
}

@media (max-width: 1199px) {
    /* Touch devices - don't dim items when not hovering */
    html.touchevents .leftnavbar ul:not(.-oneactive) > li > a,
    html.touchevents .leftnavbar ul:not(.-oneactive) > li > span > * {
        opacity: 1 !important;
    }
}
