/* --- Header & Navbar --- */
.header {
    background-color: var(--card-bg-color);
    padding: 0 2rem;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 10002;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: background-color var(--transition-speed);
}

.header__container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.header__logo i {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.header__logo .logo-TKJ {
    color: var(--primary-color);
}

.header__nav-actions {
    display: flex;
    align-items: center;
}

.nav {
    display: flex;
    align-items: center;
}

.nav__list {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.35rem;
}

.nav__item {
    margin-left: 0;
}

.nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--text-color-light);
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    position: relative;
    transition: all var(--transition-fast);
}

.nav__link i {
    font-size: 1.15rem;
    color: var(--text-color-light);
    transition: color var(--transition-fast);
}

.nav__link::after {
    display: none;
}

.nav__link:hover {
    color: var(--text-color);
    background-color: var(--secondary-color);
}

.nav__link:hover i {
    color: var(--text-color);
}

.nav__link.active {
    color: var(--primary-color);
    background-color: rgba(26, 115, 232, 0.09);
    font-weight: 600;
}

.nav__link.active i {
    color: var(--primary-color);
}

html.dark .nav__link.active {
    color: #8ab4f8;
    background-color: rgba(138, 180, 248, 0.14);
}

html.dark .nav__link.active i {
    color: #8ab4f8;
}

.hamburger {
    display: none; 
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    line-height: 1;
    height: 44px;
    width: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--transition-fast);
}
.hamburger:hover {
     background-color: var(--secondary-color);
}

/* --- Profile Dropdown (Modern) --- */
.profile-dropdown {
    position: relative;
    margin-left: 1rem;
}

.profile-dropdown__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.profile-dropdown__toggle:hover,
.profile-dropdown__toggle[aria-expanded="true"] {
    background-color: var(--border-color);
    border-color: var(--primary-color);
}
html.dark .profile-dropdown__toggle {
    background-color: #282a2d;
    border-color: #444746;
}
html.dark .profile-dropdown__toggle:hover,
html.dark .profile-dropdown__toggle[aria-expanded="true"] {
    background-color: #3c4043;
    border-color: #8ab4f8;
}
.profile-dropdown__toggle.no-arrow {
    cursor: default;
}
.profile-dropdown__toggle.no-arrow:hover {
    background-color: transparent;
}
.profile-dropdown__toggle.no-arrow .profile-dropdown__arrow {
    display: none;
}


.profile-dropdown__toggle i:first-child {
    font-size: 1.8rem;
    color: var(--text-color-light);
}

.profile-dropdown__username {
    font-weight: 500;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 0.9rem;
}

.profile-dropdown__arrow {
    font-size: 1.2rem;
    color: var(--text-color-light);
    transition: transform var(--transition-fast);
}
.profile-dropdown__toggle[aria-expanded="true"] .profile-dropdown__arrow {
    transform: rotate(180deg);
}

.profile-dropdown__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    z-index: 10005;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-dropdown__menu.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.profile-dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.9rem;
    color: var(--text-color);
    border-radius: 8px;
    transition: all var(--transition-speed);
}
.profile-dropdown__item:hover {
    background-color: var(--secondary-color);
}

.profile-dropdown__item i {
    font-size: 1.2rem;
    color: var(--text-color-light);
    transition: color var(--transition-fast);
}

.profile-dropdown__item.is-logout {
    color: var(--danger-color);
    font-weight: 500;
}
.profile-dropdown__item.is-logout i {
    color: var(--danger-color);
}
.profile-dropdown__item.is-logout:hover {
    background-color: var(--danger-color-light-bg);
}

/* --- Nav Dropdown (Lainnya) --- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown__toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.nav-dropdown__toggle i {
    transition: transform var(--transition-fast);
    font-size: 1.2rem;
}

.nav-dropdown.is-open .nav-dropdown__toggle i {
    transform: rotate(180deg);
}

.nav-dropdown .nav-dropdown__toggle.active {
    color: var(--primary-color);
}

.nav-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    list-style: none;
    padding: 0.5rem;
    margin: 0;
    width: 180px;
    z-index: 1050;
    border: 1px solid var(--border-color);
    animation: fadeInDropdown 0.2s ease-out;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}


.nav-dropdown.is-open .nav-dropdown__menu {
    display: block;
}

.nav-dropdown__menu li {
    width: 100%;
}

.nav-dropdown__menu .nav__link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    width: 100%;
    color: var(--text-color-light);
}

.nav-dropdown__menu .nav__link::after {
    display: none;
}

.nav-dropdown__menu .nav__link:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.nav-dropdown__menu .nav__link.active {
    background-color: var(--secondary-color);
    color: var(--primary-color) !important;
    font-weight: 600;
}


@media (max-width: 992px) {
    .nav__item {
        margin-left: 0.5rem;
    }
    .nav__link {
        padding: 0.5rem;
    }
}

@media (max-width: 840px) {
    .header {
        padding: 0 1rem;
    }
    
    .header__logo {
        font-size: 1.2rem;
    }

    .header__logo i {
        font-size: 1.7rem;
    }
    
    .nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }
    
    .header .profile-dropdown {
        display: none !important;
    }

    .nav-dropdown {
        display: none;
    }
}

/* --- Guest Mode Badge & Banner --- */
.badge-guest {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.35);
    margin-left: 0.35rem;
    vertical-align: middle;
}

.guest-mode-banner {
    background: linear-gradient(90deg, #1e3a8a, #1e40af);
    color: #ffffff;
    padding: 0.65rem 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 990;
    font-size: 0.88rem;
}

.guest-mode-banner__container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.guest-mode-banner__info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    line-height: 1.4;
}

.guest-mode-banner__info i {
    font-size: 1.35rem;
    color: #93c5fd;
    flex-shrink: 0;
}

.guest-mode-banner__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    background: #ffffff;
    color: #1e3a8a !important;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.guest-mode-banner__btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

@media (max-width: 640px) {
    .guest-mode-banner {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    .guest-mode-banner__container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .guest-mode-banner__btn {
        align-self: flex-end;
    }
}