/* --- bagian tombol navbar/menu saat di minimize --- */

/* --- Media query for smaller screens --- */
@media (max-width: 991.98px) {
    /* ... kode CSS lainnya untuk mobile ... */

    /* Pastikan ikon hamburger terlihat */
    .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.5) !important; /* Tambahkan border putih tipis */
    }

    .navbar-toggler-icon {
        /* Memaksa ikon hamburger menjadi putih */
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }
}


/* --- NAVBAR CUSTOM STYLES (NAVY BLUE) --- */
nav.navbar {
    /* Set a solid background color using the new variable */
    background-color: var(--navbar-bg-color) !important;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 15px var(--shadow-color-dark); /* Adjusted shadow for darker background */
    border-bottom: 1px solid var(--border-color-dark); /* Thin bottom line for definition */
}

/* Ensure no other Bootstrap classes override background */
.navbar-expand-lg.bg-light,
.navbar.navbar-dark {
    background: none !important; /* Reset all background properties */
    border-bottom: none !important;
}

.navbar-brand {
    font-family: 'Georgia', serif;
    font-weight: 700;
    color: var(--text-light) !important; /* Brand text (Brownies Anugerah) should be white */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand img {
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4); /* Clear border for logo */
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.08); /* Soft logo shadow */
    transition: transform 0.2s ease-in-out;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.navbar-toggler {
    border: none;
    opacity: 0.8;
    transition: opacity 0.2s ease-in-out;
}
.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.2); /* Soft white focus ring */
}
.navbar-toggler-icon {
    /* Ensures the hamburger icon is white against the navy blue background */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3csvg%3e");
}

/* All navigation text color should be white */
.navbar-nav .nav-link {
    color: var(--text-light) !important; /* Main nav links should be white */
    font-weight: 500;
    padding: 0.8rem 1.2rem;
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Elegant Underline Hover Effect */
.nav-item-effect::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--accent-color); /* Accent color underline (light blue) */
    transition: width 0.3s ease-in-out, left 0.3s ease-in-out;
}

.nav-item-effect:hover::before {
    width: 100%;
    left: 0;
}

.navbar-nav .nav-link:hover {
    color: var(--text-hover-light) !important; /* Slightly dimmer white on hover */
    background-color: rgba(255,255,255,0.05); /* Very subtle white transparent background on hover */
    border-radius: 5px;
}

/* --- ACTIVE NAV LINK STYLING (REVISED - Fixes "jump" issue) --- */
.navbar-nav .nav-link.active {
    color: var(--text-light) !important; /* Active link text remains white */
    background-color: rgba(255,255,255,0.15); /* Slightly more prominent active background */
    border-radius: 5px; /* Consistent border-radius with hover */
    /* Use a very subtle, internal shadow to avoid outward expansion */
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3); /* Softer inner shadow */
    font-weight: 600; /* Make active text a bit bolder for distinction */
}

/* Ensure the underline effect doesn't interfere with active state */
.navbar-nav .nav-link.active::before {
    width: 0 !important; /* No underline for active link */
}

/* For the dropdown toggle in active state */
.navbar-nav .dropdown-toggle.active {
    /* Apply similar styling to the dropdown toggle when its child page is active */
    background-color: rgba(255,255,255,0.15);
    border-radius: 5px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

/* --- DROPDOWN MENUS --- */
.dropdown-menu {
    background-color: var(--dropdown-bg-color); /* Darker navy blue dropdown background */
    border: 1px solid var(--dropdown-border); /* Clearer dropdown border */
    border-radius: 8px;
    box-shadow: 0 5px 20px var(--dropdown-shadow); /* Stronger and elegant shadow */
    min-width: 220px;
    padding: 0.5rem 0; /* Slight vertical padding */
    /* Ensure you have Animate.css linked if you use 'animate__animated animate__fadeInDown' in HTML */
    animation-duration: 0.3s; /* Animate.css animation duration */
}

.dropdown-menu .dropdown-item {
    color: var(--text-light) !important; /* White dropdown item text */
    padding: 0.8rem 1.2rem;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease; /* Smooth transitions */
    border-radius: 6px; /* Slightly rounded corners */
    margin: 0 0.5rem; /* Horizontal margin to 'float' from border */
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background-color: var(--dropdown-bg-hover); /* Light background on hover */
    color: var(--dropdown-text-hover) !important; /* Off-white text on hover */
    transform: translateX(5px); /* Slight right shift on hover */
}

/* Logout Button Specific Styling */
.logout-btn {
    border-color: var(--accent-color) !important; /* Accent color border */
    color: var(--accent-color) !important; /* Accent color text */
    font-weight: 600;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.logout-btn:hover {
    background-color: var(--accent-color) !important; /* Accent color background on hover */
    color: var(--primary-black) !important; /* Black text on hover */
    transform: translateY(-2px);
}
.logout-btn i {
    color: inherit !important;
}

/* --- Media query for smaller screens --- */
@media (max-width: 991.98px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    .navbar-brand img {
        width: 35px;
        height: 35px;
    }
    .navbar-nav {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .navbar-nav .nav-item {
        margin-bottom: 8px;
    }
    .navbar-nav .nav-link {
        padding: 0.6rem 1rem;
        color: var(--text-light) !important; /* Keep text white in mobile dropdown */
    }
    .navbar-nav .nav-link.active {
        padding-left: 1rem; /* Adjust padding for mobile active state */
        padding-right: 1rem; /* Adjust padding for mobile active state */
        color: var(--text-light) !important; /* Keep text white in mobile dropdown */
    }
    .dropdown-menu {
        border: none;
        border-radius: 0;
        background-color: var(--dropdown-bg-color); /* Use the same dark navy for mobile dropdown */
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        margin: 0; /* Remove horizontal margin on mobile */
    }
    .dropdown-menu .dropdown-item {
        padding-left: 2rem;
        margin: 0; /* Remove horizontal margin on mobile */
        border-radius: 0; /* Remove radius on mobile */
    }
    .nav-item-effect::before {
        display: none; /* Hide underline effect on mobile */
    }
    .logout-btn {
        width: 100%;
        margin-top: 10px;
    }
}