﻿/* --- RESET & BASICS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

/* --- CONTAINER --- */
.glass-nav-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding: 10px 20px;
    pointer-events: none;
}

/* --- NAVBAR (Compact Island Style) --- */
.glass-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: fit-content;
    min-width: 0;
    padding: 0 20px;
    height: 50px;
    position: relative;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.4s ease forwards;
    overflow: visible;
}

/* --- DESKTOP PARTICLES --- */
#nav-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    border-radius: 50px;
    pointer-events: none;
    overflow: hidden;
}

/* --- BRAND SECTION --- */
.nav-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 5;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards 0.1s;
    margin-right: 25px;
    padding-right: 25px;
    position: relative;
}

    .nav-brand::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        height: 32px;
        width: 1px;
        background-color: rgba(0, 0, 0, 0.12);
    }

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 0;
    height: 100%;
    transition: opacity 0.2s ease;
    z-index: 5;
}

.brand-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
    display: block;
}

.brand-text {
    font-size: 17px;
    font-weight: 700;
    color: #000000;
    letter-spacing: -0.4px;
}

/* --- LINKS CONTAINER --- */
.nav-links {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: flex-end;
    align-items: center;
    z-index: 5;
}

    .nav-links li {
        padding: 0;
        opacity: 0;
        animation: fadeIn 0.4s ease forwards;
        position: relative;
    }

        .nav-links li:nth-child(1) {
            animation-delay: 0.1s;
        }

        .nav-links li:nth-child(2) {
            animation-delay: 0.15s;
        }

        .nav-links li:nth-child(3) {
            animation-delay: 0.2s;
        }

        .nav-links li:nth-child(4) {
            animation-delay: 0.25s;
        }

        .nav-links li:nth-child(5) {
            animation-delay: 0.3s;
        }

        .nav-links li:nth-child(6) {
            animation-delay: 0.35s;
        }

.nav-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    stroke-width: 2.2px;
}

/* --- LINK ITEMS --- */
.nav-links > li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    min-width: 68px;
    height: 36px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    /* ROUNDED PILL SHAPE MATCHING NAVBAR */
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    white-space: nowrap;
}

    .nav-links > li > a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: #000000;
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .nav-links > li > a:hover {
        color: #000000;
    }

        .nav-links > li > a:hover::after {
            width: 60%;
        }

    .nav-links > li > a.active {
        background: #000000;
        color: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        transform: translateY(-1px);
    }

        .nav-links > li > a.active::after {
            display: none;
        }

    /* --- PARENT ACTIVE STATE --- */
    .nav-links > li > a.parent-active {
        background: transparent !important;
        color: #000000 !important;
        box-shadow: none !important;
        transform: none !important;
    }

        .nav-links > li > a.parent-active::after {
            display: block !important;
            width: 60% !important;
        }

/* --- DROPDOWN --- */
.dropdown-parent {
    position: relative;
}

.arrow-icon {
    width: 20px;
    height: 20px;
    margin-right: 6px;
    transition: transform 0.3s ease;
    stroke-width: 2.2px;
}

.dropdown-parent:hover .arrow-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 200px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.5);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 6px solid rgba(255, 255, 255, 0.9);
    }

.dropdown-parent:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(12px);
}

.dropdown-menu a {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    border-radius: 8px;
    transition: background 0.2s;
}

    .dropdown-menu a::after {
        display: none;
    }

    .dropdown-menu a:hover {
        background: rgba(0, 0, 0, 0.05);
        color: #000;
    }

    .dropdown-menu a.active {
        background: #000;
        color: #fff;
    }

/* --- MOBILE MENU BUTTON --- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    margin-left: 10px;
    background: transparent;
    border: none;
    pointer-events: auto;
    z-index: 6;
}

    .mobile-menu-btn span {
        width: 18px;
        height: 2px;
        background: #000;
        border-radius: 2px;
    }

/* --- MOBILE NAV PANEL --- */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 24px;
    z-index: 2000;
    transition: right 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: -4px 0 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

    .mobile-nav.active {
        right: 0;
    }

/* --- MOBILE PARTICLES --- */
#mobile-nav-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind links */
    pointer-events: none;
    overflow: hidden;
}

.mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mobile-logo {
    width: 32px;
    height: 32px;
}

.mobile-brand-text {
    font-size: 19px;
    font-weight: 700;
    color: #000;
    flex: 1;
}

.mobile-close {
    font-size: 18px;
    cursor: pointer;
    color: #555;
    border: none;
    background: transparent;
}

.mobile-nav > a {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    margin: 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #4b5563;
    text-decoration: none;
    border-radius: 10px;
    z-index: 2; /* Sit above particles */
}

    .mobile-nav > a.active {
        background: #000;
        color: #fff;
    }

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    pointer-events: none;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .glass-nav-container {
        padding: 8px 16px;
    }

    .glass-navbar {
        height: 48px;
        width: 100%;
    }

    .nav-brand {
        margin-right: 0;
        padding-right: 0;
    }

        .nav-brand::after {
            display: none;
        }

    .brand-logo {
        height: 38px;
    }
}

@media (max-width: 480px) {
    .brand-text {
        font-size: 16px;
    }

    .brand-logo {
        height: 36px;
        width: 36px;
    }

    .mobile-nav {
        width: 280px;
    }
}
