/* Navigation Bar submenu me 10 se jada menu ho to scroll bar add ho jaye */
/* Submenu scroll after many items */

.navmenu .dropdown ul li:hover > ul {
    display: block;
}

.navmenu .dropdown ul:has(.dropdown) {
    overflow: visible !important;
    max-height: none !important;
}

/* DESKTOP NAVIGATION SCROLL */
@media (min-width: 1200px) {

    .navmenu .dropdown > ul {
        max-height: 400px;
        overflow-y: auto;
        overflow-x: visible;
    }

    /* Smooth scroll */
    .navmenu .dropdown > ul {
        scroll-behavior: smooth;
    }

    /* Scrollbar */
    .navmenu .dropdown > ul::-webkit-scrollbar {
        width: 6px;
    }

    .navmenu .dropdown > ul::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #6a11cb, #2575fc);
        border-radius: 10px;
    }

    /* Child submenu FIX */
    .navmenu .dropdown .dropdown ul {
        max-height: none !important;
        overflow: visible !important;
        position: absolute;
        left: 100%;
        top: 0;
        z-index: 99999;
    }
}

@media (max-width: 1199px) {
    .navmenu .dropdown > ul {
        display: none;
    }

    .navmenu .dropdown.submenu-open > ul {
        display: block;
    }
}

/* Arrow Rotation down aarow to right arrow from hover */
/* Arrow default (down) */
.toggle-dropdown img {
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(0);
}

/* Hover par right arrow, Hover → rotate + proper dark blue color */
.navmenu li:hover > a .toggle-dropdown img {
    transform: rotate(-90deg);
    filter: invert(45%) sepia(100%) saturate(500%) hue-rotate(10deg);
}

/* Mobile open state ke liye (jab submenu open ho) */
@media (max-width: 1199px) {
    .navmenu .dropdown.submenu-open > a .toggle-dropdown img {
        transform: rotate(-90deg);
        filter: invert(45%) sepia(100%) saturate(500%) hue-rotate(10deg);
    }
}

/* ================================
   NAV MENU DESIGN ENHANCEMENT
   ================================ */

/* GAP between menu items */
.navmenu > ul > li {
    margin: 2px 2px;
}

/* Menu link base design */
.navmenu > ul > li > a {
    position: relative;
    padding: 6px 6px!important;
    border-radius: 8px;
    transition: all 0.35s ease;
    overflow: hidden;
}

/* Animated Border (multi-color) */
.navmenu > ul > li > a::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    padding: 2px;
    background: linear-gradient(270deg, #6a11cb, #2575fc, #ff6a00, #00c9ff);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    animation: borderMove 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show animated border on hover */
.navmenu > ul > li:hover > a::before {
    opacity: 1;
}

.navmenu li.active > a::before {
    opacity: 1;
    animation: borderMove 4s linear infinite;
}

/* Hover background + text color */
.navmenu > ul > li:hover > a {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff !important;
    transform: translateY(-2px);
}

/* Active state */
.navmenu .active > a {
    background: linear-gradient(135deg, #2575fc, #6a11cb);
    color: #fff !important;
}

/* FIX: Active state ko priority do */
.navmenu li.active > a {
    background: linear-gradient(135deg, #2575fc, #6a11cb) !important;
    color: #fff !important;
}

/* Hover should NOT override active */
.navmenu li.active:hover > a {
    background: linear-gradient(135deg, #2575fc, #6a11cb) !important;
    transform: none !important;
}

/* Smooth animation keyframes */
@keyframes borderMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ================================
   MOBILE IMPROVEMENTS
   ================================ */
@media (max-width: 1199px) {

    .navmenu > ul > li {
        margin: 5px 0;
    }

    .navmenu > ul > li > a {
        border-radius: 6px;
        padding: 10px 15px;
    }

    .navmenu > ul > li:hover > a {
        transform: none;
    }
}

/* Prevent horizontal scroll globally */
body {
    overflow-x: hidden;
}

/* Proper spacing without breaking layout */
@media (min-width: 1200px) {

    .navmenu ul {
        flex-wrap: wrap; /* prevents overflow */
        justify-content: center; /* optional: center align */
    }

    .navmenu li {
        margin: 0px 2px !important;
    }

    .navmenu a {
        padding: 8px 12px;
        border-radius: 6px;
        position: relative;
        overflow: hidden;
    }

    /* Gradient animated border (safe version) */
    .navmenu a::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 6px;
        padding: 1px;
        background: linear-gradient(45deg, #6a11cb, #2575fc, #ff6a00);
        -webkit-mask: 
            linear-gradient(#fff 0 0) content-box, 
            linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        opacity: 0;
        transition: 0.3s;
    }

    .navmenu a:hover::before {
        opacity: 1;
    }

    /* Background hover */
    .navmenu a:hover {
        background: linear-gradient(45deg, #6a11cb, #2575fc);
        color: #fff;
    }
}

/* MOBILE SAFE FIX */
@media (max-width: 1199px) {

    .navmenu ul {
        max-width: 100%;
        overflow-x: hidden; /* important */
    }

    .navmenu li {
        margin: 0; /* remove extra spacing */
        width: 100%;
    }

    .navmenu a {
        width: 100%;
        box-sizing: border-box;
    }
}

/* =========================
   ACTIVE MENU FIX (PARENT + CHILD)
   ========================= */

/* Parent active */
.navmenu li.active > a {
    background: linear-gradient(135deg, #2575fc, #6a11cb);
    color: #fff !important;
    opacity: 1 !important;
}

/* Child submenu active */
.navmenu .dropdown ul li.active > a {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff !important;
}

/* Hover + active consistency */
.navmenu li.active:hover > a {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
}

.navmenu .dropdown:hover > ul {
    top: 100%;
    visibility: visible;
}

@media (max-width: 1199px) {
    .navmenu .dropdown.active > ul {
        display: block;
    }
}

/* Fixed Navbar */
.header--navbar.fixed-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    animation: slideDown 0.3s ease;
}

/* Animation */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}