/* ==========================
   Import Font & Reset
========================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&display=swap');
@import url('https://fonts.googleapis.com/css?family=Raleway:400;600;700');
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==========================
   Main Header Styling
========================== */
.app-header {
    background-color: #0d2c3f;
    padding: 0 25px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body.page-dashboard .app-header {
    background-color: transparent;
    box-shadow: none;
}

body.page-dashboard .app-header.scrolled {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ==========================
   Header Layout
========================== */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    width: 100%;
}

/* ==========================
   Logo Styling
========================== */
.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 40px;
    margin-right: 12px;
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    transition: color 0.4s ease;
}

body.page-dashboard .app-header.scrolled .logo-text {
    color: #0d2c3f;
}

/* ==========================
   Mobile Navigation Toggle
========================== */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
}

.hamburger-bar {
    width: 30px;
    height: 3px;
    background-color: #fff;
    border-radius: 10px;
    transition: all 0.3s linear;
}

.mobile-nav-toggle.active .hamburger-bar:nth-child(2) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-nav-toggle.active .hamburger-bar:nth-child(3) {
    opacity: 0;
}
.mobile-nav-toggle.active .hamburger-bar:nth-child(4) {
    transform: rotate(-45deg) translate(5px, -5px);
}

body.page-dashboard .app-header.scrolled .hamburger-bar {
    background-color: #0d2c3f;
}

/* ==========================
   Navigation (Mobile)
========================== */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 100px 30px 30px 30px;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 280px;
    background: #0d2c3f;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1005;
}

.main-nav ul.active {
    transform: translateX(0);
}

.main-nav a {
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 0;
    font-family: 'Raleway', sans-serif;
}

.main-nav a.active {
    color: #fff;
    font-weight: 700;
}

.main-nav .logout-button {
    background: #1a4f6d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    text-align: center;
}

/* ==========================
   Header Right (Menu + Profil)
========================== */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 0;
}

/* Profil Dropdown */
.profile-dropdown {
    position: relative;
    display: block;
}

.profile-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.profile-toggle i {
    font-size: 28px;
    color: #fff;
    transition: color 0.4s ease;
}

body.page-dashboard .app-header.scrolled .profile-toggle i {
    color: #4a5568;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 20px);
    right: 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    width: 250px;
    z-index: 1100;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.profile-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: 15px;
    border-bottom: 1px solid #eef2f7;
}

.user-info strong {
    display: block;
    font-size: 1rem;
    color: #343a40;
    font-family: 'Poppins', sans-serif;
}

.user-info span {
    font-size: 0.85rem;
    color: #6c757d;
    font-family: 'Raleway', sans-serif;
}

.dropdown-item {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9rem;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: 'Raleway', sans-serif;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.logout {
    color: #e63946;
}

/* ==========================
   Desktop Styles (≥1200px)
========================== */
@media (min-width: 1200px) {
    .app-header {
        padding: 0 40px;
    }

    .mobile-nav-toggle {
        display: none;
    }

    .main-nav {
        display: flex;
        align-items: center;
        margin-left: auto; /* Dorong menu ke kanan */
    }

    .main-nav ul {
        position: static;
        display: flex;
        flex-direction: row;
        height: auto;
        width: auto;
        background: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
        transform: none;
        gap: 20px;
        align-items: center;
    }

    /* pastikan menu nempel di kiri profil */
    .main-nav + .header-right {
        margin-left: 10px;
    }

    .main-nav a {
        font-size: 1rem;
        padding: 8px 14px;
        color: #e0e0e0;
        text-decoration: none;
        font-weight: 600;
        font-family: 'Raleway', sans-serif;
        transition: color 0.3s ease;
    }

    .main-nav a:hover {
        color: #fff;
    }

    .profile-dropdown {
        display: block;
        margin-left: 15px;
    }
    
    .logout-button {
        display: none;
    }
}

/* ==========================
   Mobile Layout Adjustment (≤1199px)
========================== */
@media (max-width: 1199px) {
    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 8px; /* jarak kecil antara profil dan hamburger */
        margin-left: auto;
    }

    /* Tombol Profil */
    .profile-dropdown {
        position: relative;
        z-index: 1002;
        display: flex;
        align-items: center;
    }

    .profile-toggle {
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .profile-toggle i {
        font-size: 28px;
        color: #fff;
    }

    /* Tombol Hamburger */
    .mobile-nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        width: 32px;
        height: 28px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }

    .hamburger-bar {
        width: 26px;
        height: 3px;
        background-color: #fff;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Tetap 3 garis, tidak jadi X */
    .mobile-nav-toggle.active .hamburger-bar {
        transform: none;
        opacity: 1;
    }

    /* Sidebar */
    .main-nav ul {
        list-style: none;
        margin: 0;
        padding: 100px 30px 30px 30px;
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        background: #0d2c3f;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        display: flex;
        flex-direction: column;
        gap: 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 900;
    }

    .main-nav ul.active {
        transform: translateX(0);
    }

    /* Pastikan profil di atas sidebar */
    .profile-dropdown .dropdown-menu {
        top: calc(100% + 10px);
        right: 0;
        z-index: 1100;
    }
    
}


/* ==========================
   Hover Effect: Profil & Hamburger (Warna Serasi Tema)
========================== */

/* Tombol Profil Hover */
.profile-toggle:hover i {
    color: #d1e4f0; /* Biru muda lembut, tetap kontras dengan background gelap */
    transform: scale(1.1);
    transition: color 0.3s ease, transform 0.3s ease;
}

/* Saat header putih (scrolled di dashboard) */
body.page-dashboard .app-header.scrolled .profile-toggle:hover i {
    color: #0d2c3f; /* Warna utama */
    transform: scale(1.1);
}

/* Tombol Hamburger Hover */
.mobile-nav-toggle:hover .hamburger-bar {
    background-color: #d1e4f0; /* Sama tone dengan ikon profil hover */
    transform: scaleX(1.1);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Saat header putih (scrolled di dashboard) */
body.page-dashboard .app-header.scrolled .mobile-nav-toggle:hover .hamburger-bar {
    background-color: #0d2c3f;
}
