/* ================== ANIMATED HAMBURGER ICON STYLES ================== */

.navbar-toggler {
    border: none;
    padding: 0;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.hamburger-icon {
    width: 30px;
    height: 22px;
    position: relative;
    transform: rotate(0deg);
    transition: .5s ease-in-out;
    cursor: pointer;
}

.hamburger-icon span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--secondary); /* Uganda Yellow for the bars */
    border-radius: 9px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

/* Position of the 3 lines */
.hamburger-icon span:nth-child(1) {
    top: 0px;
}

.hamburger-icon span:nth-child(2) {
    top: 9px;
}

.hamburger-icon span:nth-child(3) {
    top: 18px;
}

/* This is the magic! This is what happens when the menu is OPEN */
/* Bootstrap adds the .collapsed class when the menu is open, so we target when it's NOT collapsed */
.navbar-toggler:not(.collapsed) .hamburger-icon span:nth-child(1) {
    top: 9px;
    transform: rotate(135deg);
    background: var(--accent); /* Change color to red when it's an X */
}

.navbar-toggler:not(.collapsed) .hamburger-icon span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.navbar-toggler:not(.collapsed) .hamburger-icon span:nth-child(3) {
    top: 9px;
    transform: rotate(-135deg);
    background: var(--accent); /* Change color to red when it's an X */
}

/* --- Responsive Fix for Collapsed Menu --- */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(15, 15, 15, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 15px;
        padding: 20px;
        margin-top: 15px;
        border: 1px solid rgba(255,255,255,0.1);
        width: 100%; /* Ensure it takes full width */
    }
    .navbar-nav {
        width: 100%;
        text-align: center;
    }
    .navbar-nav .nav-item {
        margin: 5px 0;
    }
    .d-flex.ms-lg-3 {
        margin-left: 0 !important; /* Remove left margin on small screens */
        margin-top: 15px;
        justify-content: center;
    }
}