/**
 * Mobile Menu Styles
 * Full-screen mobile navigation overlay with slide-in animation
 */

/* Mobile Menu Container - Hidden by default */
.mobile-menu {
    display: none;
    position: fixed;
    top: 70px; /* Below header */
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Active state - slides in from left */
.mobile-menu.active {
    transform: translateX(0);
}

/* Mobile Menu List */
.mobile-menu-list {
    list-style: none;
    padding: 1rem 1.5rem;
    margin: 0;
}

.mobile-menu-list > li {
    margin-bottom: 0.25rem;
}

.mobile-menu-list > li > a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-menu-list > li > a:hover,
.mobile-menu-list > li > a:focus {
    background: var(--color-gray-50);
    color: var(--color-primary);
}

.mobile-menu-list > li > a.active {
    background: var(--color-primary-50);
    color: var(--color-primary);
    font-weight: 600;
}

/* Mobile CTA Button */
.mobile-nav-cta {
    background: var(--color-primary) !important;
    color: white !important;
    font-weight: 600 !important;
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.875rem 1.25rem !important;
}

.mobile-nav-cta:hover,
.mobile-nav-cta:focus {
    background: var(--color-primary-dark) !important;
    color: white !important;
}

/* Mobile Dropdown */
.mobile-dropdown > a {
    position: relative;
}

.mobile-dropdown-menu {
    list-style: none;
    padding-left: 1rem;
    margin: 0.25rem 0 0 0;
    border-left: 2px solid var(--color-gray-200);
}

.mobile-dropdown-menu li {
    margin-bottom: 0.125rem;
}

.mobile-dropdown-menu a {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-dropdown-menu a:hover,
.mobile-dropdown-menu a:focus {
    background: var(--color-gray-50);
    color: var(--color-primary);
}

/* Hamburger Toggle Button Animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Body scroll lock when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Show mobile menu only on small screens */
@media (max-width: 768px) {
    .mobile-menu {
        display: block;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) {
    .mobile-menu {
        display: none !important;
    }
}

/* Accessibility - focus states */
.mobile-menu-list a:focus,
.mobile-dropdown-menu a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Dark overlay behind menu (optional - for future enhancement) */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-backdrop.active {
    display: block;
    opacity: 1;
}

/* Animation for menu items (stagger effect) */
@media (max-width: 768px) {
    .mobile-menu.active .mobile-menu-list > li {
        animation: slideInLeft 0.3s ease forwards;
        opacity: 0;
    }

    .mobile-menu.active .mobile-menu-list > li:nth-child(1) {
        animation-delay: 0.05s;
    }

    .mobile-menu.active .mobile-menu-list > li:nth-child(2) {
        animation-delay: 0.1s;
    }

    .mobile-menu.active .mobile-menu-list > li:nth-child(3) {
        animation-delay: 0.15s;
    }

    .mobile-menu.active .mobile-menu-list > li:nth-child(4) {
        animation-delay: 0.2s;
    }

    .mobile-menu.active .mobile-menu-list > li:nth-child(5) {
        animation-delay: 0.25s;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
