/* ------------------------------------------------------
   NAVBAR DESKTOP (Umum)
-------------------------------------------------------*/
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    padding: 14px 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.logo h1 {
    font-size: 1.2em;
    font-weight: 600;
    color: #24324b;
}

/* Navbar Desktop (Display di layar besar) */
.navbar-desktop { /* Nama class diubah */
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Normal Nav */
.nav-link {
    text-decoration: none;
    color: #555;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95em;
    transition: 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: #f4f6fa;
    color: #2a3a56;
}

/* ACTIVE STATE (Desktop) */
.nav-link.active {
    color: #2a3a56;
    font-weight: 600;
    border-bottom: 3px solid #2A3A56;
    padding-bottom: 7px;
}

/* BTN Registrasi Outline */
.btn-registrasi {
    border: 2px solid #2A3A56;
    background: transparent;
    color: #2A3A56;
    padding: 9px 26px;
    border-radius: 8px;
    margin-left: 20px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s ease;
}

.btn-registrasi:hover {
    background: #2A3A56;
    color: white;
}

/* Active Register Button */
.active-btn {
    background: #2A3A56 !important;
    color: white !important;
}


/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 999999; /* di bawah sidebar mobile */
}

/* Sidebar Mobile (Default disembunyikan) */
.sidebar-mobile {
    display: none;
}


/* Close Button (Default disembunyikan di desktop) */
.close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 30px;
    cursor: pointer;
    color: #2A3A56;
    font-weight: bold;
    display: none; /* Disembunyikan di desktop */
}

/* Menu Button (Default disembunyikan di desktop) */
.menu-btn {
    display: none;
}


/* ------------------------------------------------------
   RESPONSIVE MOBILE SIDEBAR (PERBAIKAN TOTAL)
-------------------------------------------------------*/
@media (max-width: 768px) {

    .header {
        padding: 12px 20px;
    }

    /* 1. Sembunyikan Navbar Desktop */
    .navbar-desktop {
        display: none;
    }

    /* 2. Tampilkan Tombol Menu */
    .menu-btn {
        display: block;
        font-size: 26px;
        cursor: pointer;
        color: #2A3A56;
    }

    /* 3. Styling Sidebar Mobile (Menggantikan .navbar lama) */
    .sidebar-mobile {
        position: fixed;
        top: 0;
        right: -100%; /* Sembunyikan ke kanan */
        width: 70%;
        height: 100vh;
        background: white;

        /* 🔥 Z-INDEX PALING TINGGI, menutupi 999999 bubble chat 🔥 */
        z-index: 1000000;

        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        padding-top: 80px;
        transition: right 0.35s ease;
    }

    /* 4. Tampilan Rapat untuk Link Sidebar */
    .sidebar-mobile .nav-link {
        width: 100%;
        text-align: left;
        color: #555;
        font-weight: 500;

        /* Menghilangkan gap, menggunakan garis pemisah */
        padding: 15px 30px;
        border-radius: 0;
        border-bottom: 1px solid #eee;
    }

    /* Active state sidebar */
    .sidebar-mobile .nav-link.active {
        color: #2A3A56;
        font-weight: 700;
        border-bottom: 1px solid #eee; /* Tetap ada garis bawah */
        border-left: 4px solid #2A3A56; /* Indikator aktif */
        padding-left: 26px; /* Menyesuaikan padding karena ada border kiri */
    }

    /* Styling Tombol Registrasi di Sidebar */
    .sidebar-mobile .btn-registrasi {
        width: 80%;
        text-align: center;
        margin: 20px 0 0 30px; /* Jarak dari atas dan indent kiri */
        padding: 9px 26px;
    }

    /* Tampilkan Sidebar saat class 'open' ditambahkan via JS */
    .sidebar-mobile.open {
        right: 0;
    }

    /* Tampilkan Close Button di mobile */
    .close-btn {
        display: block;
    }
}

/* Hide menu button on desktop */
@media (min-width: 769px) {
    .menu-btn {
        display: none;
    }
}
