/* ============================================
   RESET & BASE STYLES
   ============================================ */
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   NAVBAR CONTAINER
   ============================================ */
.nav {
    background: linear-gradient(90deg, #152e7e, #2d5e97);
    display: flex;
    align-items: center;
    justify-content: space-between; 
    padding: 0 25px; /* Padding kiri kanan */
    width: 100%;
    box-sizing: border-box; 
    
    /* Sticky/Fixed Header Logic */
    position: fixed; 
    top: 0;          
    left: 0;         
    z-index: 1000;   
    box-shadow: 0 2px 10px rgba(0,0,0,0.2); 
    height: 80px; 
    transition: all 0.3s ease;
}

/* ============================================
   BRAND & LOGO
   ============================================ */
.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1; 
    z-index: 1001; /* Agar logo tetap bisa diklik di atas menu mobile */
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand h1.teksbrand {
    margin: 0;
    font-size: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: antiquewhite;
    line-height: 1.2;
}

.mobile-subtitle {
    display: none; /* Sembunyikan di desktop */
    font-size: 12px;
    color: #e0f7fa;
    font-family: sans-serif;
}

.logo {
    width: 50px;
    height: auto;
    transition: transform 0.3s;
}

.logo:hover {
    transform: scale(1.1);
}

/* ============================================
   MIDDLE TITLE (DESKTOP ONLY)
   ============================================ */
.nav-title {
    flex: 2; 
    text-align: center;
} 

.nav-title h1 {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: bisque;
    font-size: 24px;
    margin: 0;
    white-space: nowrap;
}

/* ============================================
   MENU LIST (UL & LI)
   ============================================ */
.c {
    list-style-type: none;
    display: flex;
    gap: -10px;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: flex-end; 
    align-items: center;
}

.b a {
    text-decoration: none;
    color: rgb(222, 250, 215);
    padding: 5px 10px;
    border-radius: 20px;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 0.95em;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.b a:hover {
    color: #07afb1;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Tombol Logout Spesial */
.logout-btn a {
    background-color: rgba(255, 0, 0, 0.2);
    color: #ffd1d1;
}
.logout-btn a:hover {
    background-color: red;
    color: white;
}

/* ============================================
   HAMBURGER MENU TOGGLE (Hidden on Desktop)
   ============================================ */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1002; /* Paling atas */
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background-color: bisque;
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* Animasi Hamburger jadi X */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ============================================
   MOBILE OPTIMIZATION (MAX-WIDTH: 768px)
   ============================================ */
@media (max-width: 768px) {
    .nav {
        padding: 0 15px;
        height: 70px; /* Header sedikit lebih kecil di mobile */
    }

    .nav-title.desktop-only {
        display: none; /* Hilangkan judul tengah panjang di mobile */
    }

    .mobile-subtitle {
        display: block; /* Munculkan subtitle pendek */
    }

    .logo {
        width: 40px;
    }

    .brand h1.teksbrand {
        font-size: 18px;
    }

    /* Tampilkan Tombol Hamburger */
    .menu-toggle {
        display: flex;
    }

    /* Modifikasi Menu List untuk Mobile (Pop Up) */
    .c {
        position: absolute;
        top: 70px; /* Sesuai tinggi header */
        right: 0;
        width: 100%;
        background: linear-gradient(180deg, #119fb5, #0a8a9e);
        flex-direction: column;
        align-items: center;
        gap: 0;
        
        /* Animasi Slide Down */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
    }

    /* Class active ditambahkan via JS saat tombol diklik */
    .c.active {
        max-height: 400px; /* Cukup tinggi untuk menampung semua menu */
        padding-bottom: 20px;
    }

    .b {
        width: 100%;
        text-align: center;
        opacity: 0; /* Efek fade in item */
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    /* Delay animasi tiap item agar cantik */
    .c.active .b {
        opacity: 1;
        transform: translateY(0);
    }

    .b a {
        display: flex;
        padding: 15px;
        width: 80%; /* Lebar tombol di mobile */
        margin: 5px auto;
        border-radius: 8px;
        background-color: rgba(255,255,255,0.1);
    }

    .b a:hover {
        transform: scale(1.02);
    }
}

/* ============================================
   SMALL MOBILE (MAX-WIDTH: 480px)
   ============================================ */
@media (max-width: 480px) {
    .brand h1.teksbrand {
        font-size: 16px;
    }
    .logo {
        width: 35px;
    }
}