
/* Mobile Menu Styles */
.mobile-menu-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
    display: none;
}

.mobile-menu-button:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Hamburger icon */
.hamburger {
    width: 24px;
    height: 24px;
    position: relative;
}

.hamburger span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.hamburger span:nth-child(1) {
    top: 0px;
}

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

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

/* Hamburger animation when open */
.menu-open .hamburger span:nth-child(1) {
    top: 10px;
    transform: rotate(135deg);
}

.menu-open .hamburger span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.menu-open .hamburger span:nth-child(3) {
    top: 10px;
    transform: rotate(-135deg);
}

/* Overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    transition: opacity 0.3s ease;
}

.mobile-overlay.hide {
    opacity: 0;
    pointer-events: none;
}

/* Mobile menu */
.alpine-mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    overflow-x: hidden;
}

.alpine-mobile-menu.open {
    transform: translateX(0);
}

/* Menu panels for sliding submenus */
.menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.menu-panel.slide-left {
    transform: translateX(-100%);
}

.menu-panel.slide-right {
    transform: translateX(100%);
}

/* Menu header */
.mobile-menu-header {
    background: #4a5568;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.5rem;
    min-height: 60px;
}

.mobile-menu-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white !important;
    flex: 1;
    margin: 0;
}

/* Main menu title (no back button) - align left */
.mobile-menu-header .mobile-menu-title:first-child {
    text-align: left;
}

/* Submenu title (has back button) - center it */
.mobile-menu-header .back-button ~ .mobile-menu-title {
    text-align: center;
}

.back-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-close-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 2rem;
    line-height: 1;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.mobile-close-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Menu items */
.mobile-menu-items {
    padding: 1rem 0;
}

.mobile-menu-item {
    display: block;
    padding: 0.875rem 1.5rem;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s;
    position: relative;
}

.mobile-menu-item:hover {
    background: #f9fafb;
    color: #4a5568;
    text-decoration: none;
}

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

/* Parent menu items with submenus */
.menu-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.menu-parent .chevron {
    transition: transform 0.2s ease;
    font-size: 1.2rem;
    color: #6b7280;
}

.menu-parent:hover .chevron {
    color: #4a5568;
}

/* Submenu items */
.mobile-submenu-item {
    display: block;
    padding: 0.75rem 1.5rem 0.75rem 3rem;
    color: #4b5563;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.mobile-submenu-item:hover {
    background: #f3f4f6;
    color: #374151;
    padding-left: 3.5rem;
    text-decoration: none;
}

.mobile-submenu-item:last-child {
    border-bottom: none;
}

/* Menu item animations */
.mobile-menu-item {
    opacity: 0;
    transform: translateX(20px);
    animation: slideInLeft 0.3s ease forwards;
}

.mobile-menu-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-item:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu-item:nth-child(6) { animation-delay: 0.35s; }
.mobile-menu-item:nth-child(7) { animation-delay: 0.4s; }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Submenu animations */
.mobile-submenu-item {
    opacity: 0;
    transform: translateX(15px);
    animation: slideInSubmenu 0.2s ease forwards;
}

.mobile-submenu-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-submenu-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-submenu-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-submenu-item:nth-child(4) { animation-delay: 0.25s; }

@keyframes slideInSubmenu {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Special login button */
.mobile-login-button {
    margin: 1rem 1.5rem;
    background: #4a5568;
    color: white;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: calc(100% - 3rem);
    transition: background-color 0.2s;
}

.mobile-login-button:hover {
    background: #2d3748;
}

/* Smooth body scroll lock */
body.menu-open {
    overflow: hidden;
}

/* Show mobile menu button only on mobile */
@media (max-width: 991px) {
    .mobile-menu-button {
        display: block !important;
    }
    
    .navbar-toggler {
        display: none !important;
    }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .alpine-mobile-menu {
        width: 280px;
    }
}

/* Animation improvements */
@media (prefers-reduced-motion: reduce) {
    .alpine-mobile-menu,
    .mobile-overlay,
    .hamburger span,
    .mobile-menu-item {
        transition: none;
    }
}