/* ------------------------------------------------------
   NAVBAR DESKTOP (Umum)
-------------------------------------------------------*/
.header {
    position: sticky;
    top: 0;
    z-index: 9999;
    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);
    max-width: 1600px; /* Supaya tetap luas di monitor PC */


}

/* 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: 5px;

}

/* Normal Nav */
.nav-link {
    text-decoration: none;
    color: #555;
    padding: 10px 15px;
    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;
    }
}

/* NAVBAR 2 */
.second-navbar-wrapper {
    position: -webkit-sticky; /* Untuk Safari */
    position: sticky;
    top: 70px; /* Pastikan ini sama dengan tinggi .header */
    z-index: 9999; /* Satu angka di bawah .header (9999) agar tidak tumpang tindih aneh */
    background: #2A3A56;
    width: 100%;
}
/* NAVBAR */
.second-navbar {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;      /* kiri → kanan */
    justify-content: flex-end; /* 🔥 PINDAH KE UJUNG KANAN */
    gap: 50px;
    align-items: center;
    padding: 16px 32px;
}

/* LINK */
.second-navbar a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* CONTACT BUTTON */
.second-navbar .btn {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    padding: 5px 15px;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.25s ease;
}

.second-navbar .btn:hover {
    background: #fff;
    color: #2A3A56;
}

/* Container Utama Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Tombol Dropdown */
.dropbtn {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.dropdown:hover .arrow {
    transform: rotate(180deg);
}

/* Panel Content */
.dropdown-content {
    position: absolute;
    top: 120%; /* Sedikit jarak agar tidak langsung menempel */
    right: 0;
    background-color: #ffffff;
    min-width: 600px; /* Lebar optimal untuk 3 kolom */
    box-shadow: 0px 15px 40px rgba(0,0,0,0.12);
    border-radius: 16px;
    padding: 24px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(42, 58, 86, 0.08); /* Border tipis warna identity */
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    top: 100%;
}

/* Grid Wrapper 3x3 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Item di dalam Grid */
.grid-item {
    display: flex !important; /* Overide a tag default */
    align-items: center;
    gap: 12px;
    padding: 12px !important;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.grid-item:hover {
    background: #f8f9fb;
    transform: scale(1.02);
}

/* Icon Bulat */
.grid-item .icon {
    background: #2A3A56; /* Identity Color */
    color: #ffffff;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 15px;
    transition: transform 0.3s ease;
}

.grid-item:hover .icon {
    transform: rotate(5deg);
}

/* Typography */
.grid-item .text {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}

.grid-item .title {
    color: #2A3A56 !important; /* Identity Color */
    font-weight: 700 !important;
    font-size: 13px !important;
    margin: 0;
}

.grid-item .desc {
    color: #94a3b8 !important; /* Soft grey text */
    font-size: 11px !important;
    font-weight: 400 !important;
}

@media (max-width: 768px) {
    /* Sembunyikan Navbar 2 Wrapper di Mobile secara total */
    .second-navbar-wrapper {
        display: none;
    }

    .sidebar-mobile {
        overflow-y: auto; /* Agar menu yang panjang bisa di-scroll */
        padding-bottom: 40px;
    }

    .sidebar-divider {
        border: 0;
        border-top: 1px solid #eee;
        margin: 10px 0;
    }

    /* Dropdown Style untuk Mobile */
    .mobile-dropdown {
        width: 100%;
    }

    .mobile-dropbtn {
        width: 100%;
        padding: 15px 30px;
        background: none;
        border: none;
        border-bottom: 1px solid #eee;
        text-align: left;
        font-size: 0.95em;
        font-weight: 500;
        color: #555;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
    }

    .mobile-drop-content {
        background: #f8f9fb;
        display: none; /* Default sembunyi, tampilkan pakai JS atau hover */
    }

    /* Saat terbuka (bisa ditambah class .show via JS) */
    .mobile-dropdown:hover .mobile-drop-content {
        display: block;
    }

    .mobile-drop-content a {
        display: block;
        padding: 12px 45px;
        text-decoration: none;
        color: #666;
        font-size: 0.9em;
        border-bottom: 1px solid #edf0f5;
    }

   .nav-btn-mobile {
        background: #2A3A56 !important;
        color: white !important;
        /* Menghilangkan margin kiri yang bikin melenceng */
        margin: 20px 15px !important;
        padding: 12px !important;
        text-align: center !important;
        border-radius: 8px !important;
        display: block;
        /* Menghitung lebar agar pas dengan padding sidebar */
        width: calc(100% - 30px);
        border: none !important;
    }

    /* Memastikan link biasa tidak punya border-left yang aneh jika tidak aktif */
    .sidebar-mobile .nav-link {
        border-left: 4px solid transparent; /* Agar sejajar dengan yang active */
    }
}
