/* =========================================
   USER NAVBAR - EDUVIA-PPA
========================================= */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin: 18px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border: 1px solid #ececf5;
    border-radius: 22px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 8px 30px rgba(31, 42, 99, 0.06);
}

.navbar-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1f2a63;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
    margin-left: auto;
}

/* Guard untuk markup lama yang tidak sengaja menaruh dropdown langsung di .menu. */
.menu > .dropdown-toggle,
.menu > .dropdown-menu {
    display: none !important;
}

.menu a,
.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 13px;
    text-decoration: none;
    color: #1f2a63;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    transition: 0.22s ease;
    cursor: pointer;
    white-space: nowrap;
}

.navbar .menu > a,
.navbar .menu > a:last-child {
    background: transparent !important;
    color: #1f2a63 !important;
    box-shadow: none !important;
    transform: none !important;
    min-height: 40px !important;
    padding: 9px 13px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.menu a:hover,
.dropdown-toggle:hover,
.navbar .menu > a:hover,
.navbar .menu > a:last-child:hover {
    background: #f4f5ff !important;
    color: #3b4bdf !important;
    box-shadow: none !important;
    transform: none !important;
}

.menu a.active,
.menu-dropdown.active .dropdown-toggle,
.navbar .menu > a.active,
.navbar .menu > a:last-child.active {
    background: #eef0ff !important;
    color: #3b4bdf !important;
    font-weight: 800 !important;
    box-shadow: none !important;
    transform: none !important;
}

.menu-dropdown {
    position: relative;
}

.menu-dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
}

.dropdown-toggle {
    gap: 6px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 240px;
    background: #ffffff;
    border-radius: 16px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    border: 1px solid #ececf5;
    box-shadow: 0 18px 42px rgba(31, 42, 99, 0.14);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.menu-dropdown.open .dropdown-menu,
.menu-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-menu a {
    width: 100%;
    justify-content: flex-start;
    min-height: 42px;
    padding: 10px 13px;
    border-radius: 11px;
    font-size: 14px;
    color: #1f2a63;
    background: transparent;
}

.navbar .menu .dropdown-menu a,
.navbar .menu .dropdown-menu a:last-child {
    background: transparent !important;
    color: #1f2a63 !important;
    box-shadow: none !important;
    transform: none !important;
    width: 100% !important;
    min-height: 42px !important;
    padding: 10px 13px !important;
    border-radius: 11px !important;
    font-size: 14px !important;
    justify-content: flex-start !important;
    text-align: left !important;
}

.dropdown-menu a:hover,
.dropdown-menu a.active,
.navbar .menu .dropdown-menu a:hover,
.navbar .menu .dropdown-menu a.active,
.navbar .menu .dropdown-menu a:last-child:hover {
    background: #eef0ff !important;
    color: #3b4bdf !important;
    box-shadow: none !important;
    transform: none !important;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-btn-ghost {
    text-decoration: none;
    color: #4b5563;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 12px;
    transition: all 0.22s ease;
}

.nav-btn-ghost:hover {
    background: #f4f5ff;
    color: #3b4bdf;
}

.nav-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    text-decoration: none;
    background: linear-gradient(135deg, #3b4bdf, #6366f1);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 12px;
    transition: all 0.22s ease;
    box-shadow: 0 8px 22px rgba(59, 75, 223, 0.28);
    white-space: nowrap;
}

.nav-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(59, 75, 223, 0.36);
}

.menu-toggle {
    display: none;
    font-size: 26px;
    cursor: pointer;
    color: #3b4bdf;
    line-height: 1;
}

@media (max-width: 1080px) {
    .navbar {
        gap: 14px;
        padding: 14px 18px;
    }

    .menu {
        gap: 3px;
    }

    .menu a,
    .dropdown-toggle {
        padding: 8px 10px;
        font-size: 13px;
    }

    .nav-btn-primary {
        padding: 9px 14px;
    }
}

@media (max-width: 860px) {
    .navbar {
        flex-wrap: wrap;
        margin: 10px;
        border-radius: 18px;
    }

    .navbar-left {
        width: 100%;
        justify-content: space-between;
    }

    .menu-toggle {
        display: block;
    }

    .menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-left: 0;
        padding-top: 14px;
        border-top: 1px solid #ececf5;
        gap: 6px;
    }

    .menu.show {
        display: flex;
    }

    .menu a,
    .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        min-height: 42px;
        padding: 10px 12px;
        font-size: 14px;
    }

    .menu-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 6px;
        box-shadow: none;
        background: #f8f8ff;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        border-radius: 14px;
    }

    .navbar-right {
        display: none;
    }
}
