/* ====================================
   ULTRA MODERN RESPONSIVE NAVBAR CSS
   OPTIMIZED VERSION - Smooth & Light
   ==================================== */

/* ========== OPTIMIZED ANIMATIONS ========== */

/* Simple slide down */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Simple pulse for active indicator */
@keyframes simple-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ========== SMOOTH ICON ROTATION - Font Awesome ========== */
.nav-link i.fa-chevron-down,
.mobile-dropdown-toggle i.fa-chevron-down,
.nav-link-with-dropdown i.fa-chevron-down {
    display: inline-block;
    margin-left: 0.0rem;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 1.0rem;
}

/* Smooth rotation when dropdown opens */
.nav-link i.fa-chevron-down.rotated,
.mobile-dropdown-toggle i.fa-chevron-down.rotated,
.nav-link-with-dropdown i.fa-chevron-down.rotated {
    transform: rotate(180deg) !important;
}

/* ========== SMOOTH ICON ROTATION - Font Awesome ========== */
.nav-link i.fa-chevron-down,
.mobile-dropdown-toggle i.fa-chevron-down {
    display: inline-block;
    margin-left: 0.0rem;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 1.0rem;
}

/* Smooth rotation when dropdown opens */
.nav-link i.fa-chevron-down.rotated,
.mobile-dropdown-toggle i.fa-chevron-down.rotated {
    transform: rotate(180deg) !important;
}

/* ========== TABLET & MOBILE RESPONSIVE ========== */
@media (max-width: 1090px) {
    
    html, body {
        width: 100%;
        max-width: 100%;
    }

    .nav-container {
        padding: 0 1rem;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .logo {
        font-size: 1.4rem;
        gap: 0.3rem;
        max-width: calc(100% - 60px);
    }

    .logo i {
        font-size: 1.2rem;
    }

    .hamburger {
        display: flex;
        min-width: 40px;
    }

    /* Prevent body scroll when menu closed */
    body {
        overflow-x: clip !important;
    }

    /* ========== MOBILE NAVIGATION MENU - OPTIMIZED ========== */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: linear-gradient(135deg, #2d5aa0 0%, #1a365d 100%);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
        overflow-y: auto;
        overflow-x: hidden;
        visibility: hidden;
        opacity: 0;
        transition: left 0.3s ease, visibility 0s linear 0.3s, opacity 0.3s ease;
        margin: 0;
        z-index: 999;
    }

    /* Menu active state */
    .nav-menu.active {
        left: 0;
        visibility: visible;
        opacity: 1;
        transition: left 0.3s ease, visibility 0s linear 0s, opacity 0.3s ease;
    }

    /* Lock body scroll when menu open */
    body.menu-open {
        overflow: hidden;
    }

    .nav-menu li {
        margin: 0.4rem 0;
        width: 90%;
        animation: slideDown 0.3s ease backwards;
    }

    .nav-menu li:nth-child(1) { animation-delay: 0.05s; }
    .nav-menu li:nth-child(2) { animation-delay: 0.1s; }
    .nav-menu li:nth-child(3) { animation-delay: 0.15s; }
    .nav-menu li:nth-child(4) { animation-delay: 0.2s; }
    .nav-menu li:nth-child(5) { animation-delay: 0.25s; }
    .nav-menu li:nth-child(6) { animation-delay: 0.3s; }

    /* ========== NAVIGATION LINKS - CLEAN & SMOOTH ========== */
    .nav-menu .nav-link {
        display: block;
        text-align: center;
        color: white !important;
        background: rgba(255, 255, 255, 0.12);
        margin: -0.5rem 0;
        padding: 1rem 1.2rem;
        border-radius: 12px;
        width: 100%;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: all 0.25s ease;
        position: relative;
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        font-weight: 500;
        letter-spacing: 0.3px;
    }

    /* Clean Hover Effect */
    .nav-menu .nav-link:hover {
        background: rgba(255, 255, 255, 0.22) !important;
        color: white !important;
        transform: translateX(5px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    /* ========== ACTIVE NAVIGATION LINK ========== */
    .nav-menu .nav-link.active {
        background: rgba(255, 255, 255, 0.25) !important;
        color: white !important;
        border: 2px solid rgba(255, 255, 255, 0.4);
        font-weight: 600;
        box-shadow: 0 0 15px rgba(45, 90, 160, 0.4);
    }

    .nav-menu .nav-link.active::after {
        display: none;
    }

    /* Active Indicator - Simple Dot */
    .nav-menu .nav-link.active::before {
        content: '';
        position: absolute;
        right: 15px;
        top: 45%;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
        background: #fa6060;
        border-radius: 50%;
        animation: simple-pulse 2s ease-in-out infinite;
        box-shadow: 0 0 8px #60a5fa;
    }

    .dropdown {
        display: none !important;
    }

    /* ========== MOBILE DROPDOWN CONTAINER ========== */
    .mobile-dropdown,
    .mobile-dropdown-content {
        display: block;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        margin-top: 0.8rem;
        width: 100%;
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-left: 4px solid rgba(96, 165, 250, 0.7);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transform: translateY(-20px) scale(0.92);
        transition: max-height 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                    margin 0.5s ease;
        transform-origin: top center;
        pointer-events: none;
    }

    .nav-item.mobile-expanded .mobile-dropdown,
    .mobile-dropdown-content.show {
        max-height: 600px;
        opacity: 1;
        transform: translateY(0) scale(1);
        margin-top: 0.8rem;
        pointer-events: auto;
    }

    /* Animasi untuk item di dalam dropdown */
    .mobile-dropdown a,
    .mobile-dropdown-content a {
        opacity: 0;
        transform: translateX(-25px);
        transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .nav-item.mobile-expanded .mobile-dropdown a,
    .mobile-dropdown-content.show a {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-item.mobile-expanded .mobile-dropdown a:nth-child(1),
    .mobile-dropdown-content.show a:nth-child(1) { transition-delay: 0.1s; }
    .nav-item.mobile-expanded .mobile-dropdown a:nth-child(2),
    .mobile-dropdown-content.show a:nth-child(2) { transition-delay: 0.2s; }
    .nav-item.mobile-expanded .mobile-dropdown a:nth-child(3),
    .mobile-dropdown-content.show a:nth-child(3) { transition-delay: 0.3s; }
    .nav-item.mobile-expanded .mobile-dropdown a:nth-child(4),
    .mobile-dropdown-content.show a:nth-child(4) { transition-delay: 0.4s; }
    .nav-item.mobile-expanded .mobile-dropdown a:nth-child(5),
    .mobile-dropdown-content.show a:nth-child(5) { transition-delay: 0.5s; }

    /* ========== MOBILE DROPDOWN LINKS - CLEAN ========== */
    .mobile-dropdown a,
    .mobile-dropdown-content a {
        display: block;
        padding: 0.9rem 1rem 0.9rem 1.5rem;
        color: white !important;
        text-decoration: none;
        background: rgba(255, 255, 255, 0.08);
        margin: 0.4rem 0.8rem;
        border-radius: 10px;
        transition: all 0.25s ease;
        text-align: left;
        font-size: 0.95rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-left: 3px solid rgba(255, 255, 255, 0.3);
        position: relative;
        font-weight: 500;
    }

    /* Arrow indicator - hidden by default */
    .mobile-dropdown a::after,
    .mobile-dropdown-content a::after {
        content: '→';
        position: absolute;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.9rem;
        opacity: 0;
        transition: all 0.25s ease;
    }

    /* Show arrow on hover */
    .mobile-dropdown a:hover::after,
    .mobile-dropdown-content a:hover::after {
        opacity: 1;
        left: 10px;
    }

    /* Clean Hover Effect */
    .mobile-dropdown a:hover,
    .mobile-dropdown-content a:hover {
        background: rgba(255, 255, 255, 0.18) !important;
        transform: translateX(5px);
        border-left: 3px solid rgba(96, 165, 250, 0.9);
        padding-left: 1.8rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    /* ========== ACTIVE SUB MENU ========== */
    .mobile-dropdown a.active-sub {
        background: rgba(255, 255, 255, 0.22) !important;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-left: 4px solid #60a5fa;
        font-weight: 600;
        box-shadow: 0 0 12px rgba(96, 165, 250, 0.3);
        padding-left: 1.8rem;
    }

    /* Active sub gets visible arrow */
    .mobile-dropdown a.active-sub::after {
        content: '→';
        opacity: 1 !important;
        color: #60a5fa;
        left: 10px;
    }
}

/* ========== SMALL MOBILE ========== */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-menu .nav-link {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .mobile-dropdown a,
    .mobile-dropdown-content a {
        padding: 0.8rem 0.9rem 0.8rem 1.3rem;
        font-size: 0.9rem;
    }
}