/* Hamburger Menu Animation Styles */
/* This is the SINGLE source of truth for hamburger sizing */

/* Hamburger button sizing - SINGLE source of truth */
@media (max-width: 991px) {
    .navbar .navbar-toggler,
    button.navbar-toggler,
    .navbar-toggler {
        position: absolute !important;
        top: 1rem !important;
        right: 1.5rem !important;
        padding: 0.5rem 0.75rem !important;
        border: 1px solid rgba(0,0,0,.1) !important;
        overflow: visible !important;
    }
}

/* Reset Bootstrap's background image for the toggler icon */
.navbar-toggler-icon {
    background-image: none !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 2.25em !important;
    height: 2.25em !important;
}

/* Individual hamburger lines */
.hamburger-line {
    width: 28px;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.75);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
    transform-origin: center;
}

/* Animate to X when menu is open */
.navbar-toggler.open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.navbar-toggler.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.navbar-toggler.open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Responsive sizing for mobile */
@media (max-width: 991px) {
    .navbar-toggler-icon {
        width: 2.25em !important;
        height: 2.25em !important;
    }
    
    .hamburger-line {
        width: 30px;
        height: 4px;
        margin: 4px 0;
    }
    
    .navbar-toggler.open .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .navbar-toggler.open .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
}

/* Focus styles for accessibility */
.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 174, 239, 0.25);
}

/* Active rules indicator - blue border and background when rules are active */
.navbar-toggler.has-active-rules {
    border-color: #00AEEF !important;
    border-width: 2px !important;
    background-color: #e6f7ff !important;
}

/* Active Rules menu item background when rules are active - ONLY for hamburger menu */
.navbar-nav.d-lg-none .nav-item.has-active-rules {
    background-color: #e6f7ff !important;
    border-radius: 0.25rem;
}

/* Hamburger numerical badge - shows count of active rules */
.hamburger-rules-count {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    transform: translate(40%, -40%) !important;
    background-color: #00AEEF !important;
    color: white !important;
    font-size: 0.85rem !important;
    font-weight: bold !important;
    padding: 2px 6px !important;
    border-radius: 50% !important;
    text-align: center !important;
    min-width: 22px !important;
    height: 22px !important;
    line-height: 18px !important;
    z-index: 1001 !important;
    pointer-events: none !important;
    display: none !important;
}

/* Show the badge when hamburger has active rules */
.navbar-toggler.has-active-rules .hamburger-rules-count {
    display: block !important;
}

/* Mobile menu count badge - circle before menu item text (mobile only) */
.mobile-menu-count-badge {
    display: inline-block !important;
    background-color: #00AEEF !important;
    color: white !important;
    font-size: 0.85rem !important;
    font-weight: bold !important;
    padding: 2px 6px !important;
    border-radius: 50% !important;
    text-align: center !important;
    min-width: 22px !important;
    height: 22px !important;
    line-height: 18px !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
    transform: translateY(-2px) !important;
}

/* Hide mobile menu count badge on desktop */
@media (min-width: 992px) {
    .mobile-menu-count-badge {
        display: none !important;
    }
}