/* ============= CSS VARIABLES ============= */
:root {
    --bs-card-bg: #fff;
    --bs-border-color: #dee2e6;
    --bs-body-color: #212529;
    --bs-tertiary-bg: #f8f9fa;
    --bs-primary: #435ebe;
    --bs-secondary-color: #6c757d;
    --bs-dark: #212529;
    --bs-white: #fff;
    --bs-gray-400: #ced4da;
    --bs-gray-600: #6c757d;
    --bs-gray-700: #495057;
    --bs-gray-800: #343a40;
}

/* ============= NAVBAR STYLES ============= */

/* Header Top */
.header-top {
    background: var(--bs-card-bg);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 1030;
    transition: all 0.3s ease;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    z-index: 1031;
}

.logo a {
    text-decoration: none;
    display: block;
}

.logo-pengaduan {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo-pengaduan:hover {
    transform: scale(1.05);
}

/* Navbar Menu */
.nav-menu {
    display: flex;
    justify-content: center;
    position: static;
}

.nav-menu ul {
    display: flex;
    justify-content: center;
    gap: 1.5rem; /* Jarak antar menu item - ubah sesuai kebutuhan */
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.nav-menu .menu-item {
    padding: 0;
}

.nav-menu .menu-link {
    text-decoration: none;
    color: var(--bs-body-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.nav-menu .menu-link:hover {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-primary);
    transform: translateY(-1px);
}

/* Active Menu Item - Smooth Style */
.nav-menu .menu-link.active {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
    color: var(--bs-primary);
    font-weight: 600;
    border: 1px solid rgba(13, 110, 253, 0.2);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.nav-menu .menu-link.active:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15), rgba(13, 110, 253, 0.08));
    color: var(--bs-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
}

/* Hamburger Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    z-index: 1031;
    padding: 5px;
}

.hamburger-btn div {
    width: 30px;
    height: 4px;
    background-color: var(--bs-body-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-btn.active div:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active div:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active div:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Header Top Right */
.header-top-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1031;
}

/* User Dropdown */
.user-dropdown {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: var(--bs-body-color);
    gap: 0.75rem;
}

.user-dropdown:hover {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

/* Avatar Styles */
.avatar {
    position: relative;
    display: inline-block;
}

.avatar.avatar-md2 {
    width: 40px;
    height: 40px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--bs-border-color);
    transition: border-color 0.3s ease;
}

.avatar img:hover {
    border-color: var(--bs-primary);
}

/* User Dropdown Text */
.user-dropdown .text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-dropdown-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--bs-body-color);
}

.user-dropdown-status {
    font-size: 0.75rem;
    margin: 0;
    color: var(--bs-secondary-color);
    text-transform: capitalize;
}

/* Dropdown Menu */
.dropdown-menu {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 180px;
    background-color: var(--bs-card-bg);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--bs-body-color);
    transition: all 0.3s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-primary);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--bs-border-color);
}

/* Login Button */
.btn-primary {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-top .container {
        flex-wrap: wrap;
        padding: 0 1rem;
    }

    .logo-pengaduan {
        height: 35px;
    }

    /* Hide navigation menu by default on mobile */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bs-card-bg);
        border-top: 1px solid var(--bs-border-color);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        width: 100%;
        order: 3;
        flex-basis: 100%;
        z-index: 1030;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        width: 100%;
    }

    .nav-menu .menu-item {
        width: 100%;
    }

    .nav-menu .menu-link {
        display: block;
        padding: 1rem 1.5rem;
        border-radius: 0;
        border-bottom: 1px solid var(--bs-border-color);
        width: 100%;
    }

    .nav-menu .menu-link.active {
        background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
        border-left: 4px solid var(--bs-primary);
        border-bottom: 1px solid var(--bs-border-color);
    }

    .nav-menu .menu-item:last-child .menu-link {
        border-bottom: none;
    }

    /* Show hamburger button */
    .hamburger-btn {
        display: flex;
        order: 2;
    }

    /* Show menu when active */
    .nav-menu.show {
        display: flex;
    }

    .user-dropdown .text {
        display: none;
    }

    .avatar.avatar-md2 {
        width: 35px;
        height: 35px;
    }

    .btn-primary {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .header-top {
        padding: 0.75rem 0;
    }

    .header-top .container {
        gap: 0.5rem;
    }

    .dropdown-menu {
        min-width: 160px;
    }
}

/* ============= DARK MODE SUPPORT ============= */

/* Header - Dark Mode */
html.theme-dark .header-top,
body.theme-dark .header-top,
[data-bs-theme="dark"] .header-top {
    background: var(--bs-dark);
    border-bottom-color: var(--bs-gray-700);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* User Dropdown - Dark Mode */
html.theme-dark .user-dropdown,
body.theme-dark .user-dropdown,
[data-bs-theme="dark"] .user-dropdown {
    color: var(--bs-white);
}

html.theme-dark .user-dropdown:hover,
body.theme-dark .user-dropdown:hover,
[data-bs-theme="dark"] .user-dropdown:hover {
    background-color: var(--bs-gray-800);
    color: var(--bs-white);
}

html.theme-dark .user-dropdown-name,
body.theme-dark .user-dropdown-name,
[data-bs-theme="dark"] .user-dropdown-name {
    color: var(--bs-white);
}

html.theme-dark .user-dropdown-status,
body.theme-dark .user-dropdown-status,
[data-bs-theme="dark"] .user-dropdown-status {
    color: var(--bs-gray-400);
}

/* Menu Links - Dark Mode */
html.theme-dark .menu-link,
body.theme-dark .menu-link,
[data-bs-theme="dark"] .menu-link {
    color: var(--bs-white);
}

html.theme-dark .menu-link:hover,
body.theme-dark .menu-link:hover,
[data-bs-theme="dark"] .menu-link:hover {
    background-color: var(--bs-gray-800);
    color: var(--bs-primary);
}

/* Active Menu Link - Dark Mode - Smooth Style */
html.theme-dark .menu-link.active,
body.theme-dark .menu-link.active,
[data-bs-theme="dark"] .menu-link.active {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.2), rgba(13, 110, 253, 0.1));
    color: #66b3ff;
    border: 1px solid rgba(13, 110, 253, 0.3);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

html.theme-dark .menu-link.active:hover,
body.theme-dark .menu-link.active:hover,
[data-bs-theme="dark"] .menu-link.active:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.25), rgba(13, 110, 253, 0.15));
    color: #66b3ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

/* Hamburger - Dark Mode */
html.theme-dark .hamburger-btn div,
body.theme-dark .hamburger-btn div,
[data-bs-theme="dark"] .hamburger-btn div {
    background-color: var(--bs-white);
}

/* Mobile Menu - Dark Mode */
html.theme-dark .nav-menu,
body.theme-dark .nav-menu,
[data-bs-theme="dark"] .nav-menu {
    background: var(--bs-dark);
    border-top-color: var(--bs-gray-700);
}

/* Avatar - Dark Mode */
html.theme-dark .avatar img,
body.theme-dark .avatar img,
[data-bs-theme="dark"] .avatar img {
    border-color: var(--bs-gray-600);
}

html.theme-dark .avatar img:hover,
body.theme-dark .avatar img:hover,
[data-bs-theme="dark"] .avatar img:hover {
    border-color: var(--bs-primary);
}

/* Dropdown Menu - Dark Mode */
html.theme-dark .dropdown-menu,
body.theme-dark .dropdown-menu,
[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--bs-dark);
    border-color: var(--bs-gray-700);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.theme-dark .dropdown-item,
body.theme-dark .dropdown-item,
[data-bs-theme="dark"] .dropdown-item {
    color: var(--bs-white);
}

html.theme-dark .dropdown-item:hover,
body.theme-dark .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:hover,
html.theme-dark .dropdown-item:focus,
body.theme-dark .dropdown-item:focus,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: var(--bs-gray-800);
    color: var(--bs-primary);
}

html.theme-dark .dropdown-divider,
body.theme-dark .dropdown-divider,
[data-bs-theme="dark"] .dropdown-divider {
    border-color: var(--bs-gray-700);
}

/* Smooth Transitions */
.header-top,
.user-dropdown,
.dropdown-menu,
.dropdown-item,
.avatar img,
.btn-primary,
.menu-link,
.hamburger-btn div {
    transition: all 0.3s ease;
}