/* =========================
   NAVBAR MAIN
========================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 18px 0;
    background: linear-gradient(to right, #000000, #0a0a0a, #000000);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Center Glow Effect */
.navbar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 100%;
    background: radial-gradient(circle, rgba(234,179,8,0.15) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* =========================
   LOGO
========================= */

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 70px;     /* Main desktop size */
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

/* Slight hover animation */
.logo-img:hover {
    transform: scale(1.05);
}

/* Tablet */
@media (max-width: 1024px) {
    .logo-img {
        height: 60px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .logo-img {
        height: 48px;
    }
}

/* =========================
   NAV LINKS
========================= */
.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 35px;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: #cfcfcf;
    font-size: 15px;
    font-weight: 500;
    position: relative;
    transition: 0.3s ease;
}

/* Underline Animation */
.nav-menu a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    background: #eab308;
    left: 0;
    bottom: -6px;
    transition: 0.3s ease;
}

.nav-menu a:hover {
    color: #ffffff;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* =========================
   CTA BUTTON
========================= */
.nav-btn {
    background: #eab308;
    color: #ffffff;
}

.nav-btn:hover {
    background: #facc15;
    color: ffffff;
}

/* =========================
   MOBILE MENU
========================= */
.menu-toggle {
    display: none;
    font-size: 26px;
    cursor: pointer;
}


.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 40px;
    left: 0;
    background: #111;
    min-width: 220px;
    border-radius: 10px;
    padding: 15px 0;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

.dropdown-menu li {
    padding: 8px 20px;
}

.dropdown-menu a {
    color: #cfcfcf;
    font-size: 14px;
    display: block;
    transition: 0.3s;
}

.dropdown-menu a:hover {
    color: #eab308;
}

/* Show dropdown on hover only for hover-capable devices (desktop/tablet) */
@media (hover: hover) and (min-width: 769px) {
    /* Keep the dropdown in the DOM but hidden — use visibility/opacity so it doesn't capture pointer events
       when hidden. This prevents overlapping dropdowns from being triggered when one opens. */
    .dropdown-menu {
        /* keep in DOM but hidden until hovered */
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
        pointer-events: none;
        min-width: 600px; /* wider for grid */
        padding: 5px;
    }

    /* two-column grid for dropdown items on desktop */
    .dropdown-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 9px;
    }

    .dropdown-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        border-radius: 8px;
        background: transparent;
        transition: background 0.18s ease, color 0.18s ease;
        width: 100%;
        box-sizing: border-box;
    }

    .dropdown-item .icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: rgba(234,179,8,0.06);
        color: #eab308;
        flex: 0 0 40px;
    }

    .icon-svg {
        display: block;
        width: 20px;
        height: 20px;
    }

    .dropdown-item .label {
        color: #cfcfcf;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dropdown-item:hover {
        background: rgba(234,179,8,0.04);
    }

    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
        animation: none; /* handled by transition for smoother UX */
    }
    /* Also support programmatic open via .open class (click) */
    .dropdown.open .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}


/* Tablet */
@media (max-width: 1024px) {
    .nav-menu ul {
        gap: 25px;
    }
}

/* Mobile */
@media (max-width: 768px) {

    .menu-toggle {
        display: block;
        color: #fff;
    }

    .nav-menu {
        position: absolute;
        top: 75px;
        left: 0;
        width: 100%;
        background: #0a0a0a;
        padding: 25px 0;
        display: none;
        border-top: 1px solid rgba(255,255,255,0.05);
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .nav-menu.active {
        display: block;
    }

    /* Mobile: make dropdowns stack under the parent item when opened */
    .dropdown-menu {
        position: static;
        top: auto;
        left: auto;
        background: transparent;
        box-shadow: none;
        border: none;
        padding: 0;
        min-width: 0;
    }

    .dropdown-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px 20px;
    }

    .dropdown.open .dropdown-menu {
        display: block; /* shown when JS toggles .open on the dropdown */
    }

    .dropdown-item {
        padding: 12px 0;
        border-radius: 0;
    }

    .dropdown-item .icon {
        width: 28px;
        height: 28px;
    }

}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}