/**
 * Mobile Menu Hamburger Component
 * Responsive hamburger menu with overlay and animations
 */

/* Hamburger Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative;
}

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

.hamburger span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: #2c3e50;
    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: 9px;
}

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

/* Active state (X) */
.mobile-menu-toggle.active .hamburger span:nth-child(1) {
    top: 9px;
    transform: rotate(135deg);
}

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

.mobile-menu-toggle.active .hamburger span:nth-child(3) {
    top: 9px;
    transform: rotate(-135deg);
}

/* Mobile Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Menu Drawer */
.mobile-menu-drawer {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    pointer-events: none;
}

.mobile-menu-drawer.active {
    transform: translateX(0);
    pointer-events: auto;
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    color: #666;
    line-height: 1;
}

.mobile-menu-nav {
    padding: 0;
}

.mobile-menu-nav a {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.mobile-menu-nav a:hover {
    background: #f8f9fa;
}

.mobile-menu-nav a:active {
    background: #e9ecef;
}

.mobile-menu-icon {
    margin-right: 12px;
    font-size: 20px;
}

.mobile-menu-badge {
    margin-left: auto;
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* Hide normal header when compact header is visible */
.header.hidden-on-scroll {
    display: none !important;
}

/* Compact Header on Scroll */
.header-compact {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 10px 0;
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    transition: clip-path 0.7s ease, opacity 0.4s ease;
    overflow: hidden;
}

.header-compact.visible {
    clip-path: inset(0 0 0 0);
    opacity: 1;
}

.header-compact .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 0 var(--spacing-md, 16px);
}

.header-compact .logo {
    display: flex;
    align-items: center;
}

.header-compact .logo img,
.header-compact .compact-logo {
    max-height: 40px !important;
    height: auto !important;
    max-width: 120px !important;
    width: auto !important;
    object-fit: contain;
}

.header-compact .mobile-menu-toggle {
    display: block;
}

/* Mobile and Tablet specific styles */
@media (max-width: 1024px) {
    /* Show hamburger button */
    .mobile-menu-toggle {
        display: block;
    }

    /* Hide desktop nav if exists */
    .header .nav {
        display: none !important;
    }

    /* Show mobile components */
    .mobile-menu-overlay,
    .mobile-menu-drawer {
        display: block;
    }
}

@media (min-width: 1025px) {
    /* On desktop, hide by default and show on scroll */
    .header-compact {
        display: block;
    }
}

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

/* Animation for menu items */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu-drawer.active .mobile-menu-nav a {
    animation: slideInRight 0.3s ease forwards;
}

.mobile-menu-drawer.active .mobile-menu-nav a:nth-child(1) {
    animation-delay: 0.05s;
}

.mobile-menu-drawer.active .mobile-menu-nav a:nth-child(2) {
    animation-delay: 0.1s;
}

.mobile-menu-drawer.active .mobile-menu-nav a:nth-child(3) {
    animation-delay: 0.15s;
}

.mobile-menu-drawer.active .mobile-menu-nav a:nth-child(4) {
    animation-delay: 0.2s;
}

.mobile-menu-drawer.active .mobile-menu-nav a:nth-child(5) {
    animation-delay: 0.25s;
}
