/*
 * Mobile Hamburger Menu Styles
 * Professional, responsive navigation menu
 * Version: 2.0.0
 * Complete self-contained menu system - Production Ready
 */

/* ===================================
   MOBILE HEADER LAYOUT
   =================================== */

/* Mobile Controls Group - Hidden on Desktop */
.mobile-controls-group {
    display: none;
}

/* Mobile Controls Buttons */
.mobile-search-toggle,
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    order: 4;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.mobile-search-toggle:hover,
.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.mobile-search-toggle.active,
.mobile-menu-toggle.active {
    background-color: #00d4aa;
    color: #1a1d23;
    transform: scale(1.1);
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Mobile menu backdrop */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-backdrop.active {
    display: block;
    opacity: 1;
}

/* Mobile Responsive Styles for Header */
@media (max-width: 768px) {
    .mobile-controls-group {
        display: flex;
        margin-left: auto;
        order: 3;
    }

    .mobile-search-toggle,
    .mobile-menu-toggle {
        display: flex;
    }

    /* Group logo on the left, hamburger on the right */
    .header-left-group {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        order: 1;
        z-index: 1000;
        padding: 0.25rem 0;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .logo {
        order: 1;
        z-index: 1000;
        flex: 0 1 auto;
        margin: 0;
        font-size: 1.5rem;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    /* Hamburger button - positioned on right */
    .mobile-controls-group {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
        z-index: 1000;
        padding: 0;
        margin: 0;
        margin-left: auto;
        background: transparent;
        border: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-controls-group:hover {
        background: transparent;
    }

    .mobile-search-toggle {
        display: none;
    }

    .mobile-menu-toggle {
        order: 1;
        z-index: 1000;
    }

    /* Hide logo and hamburger when mobile menu is active */
    body.mobile-menu-open .header-left-group {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    body.mobile-menu-open .logo {
        opacity: 0;
        visibility: hidden;
    }

    body.mobile-menu-open .mobile-controls-group {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    body.mobile-menu-open .mobile-menu-toggle {
        opacity: 0;
        visibility: hidden;
    }

    /* Restore logo and hamburger when menu is closed */
    body:not(.mobile-menu-open) .header-left-group {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body:not(.mobile-menu-open) .logo {
        opacity: 1;
        visibility: visible;
    }

    body:not(.mobile-menu-open) .mobile-controls-group {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body:not(.mobile-menu-open) .mobile-menu-toggle {
        opacity: 1;
        visibility: visible;
    }

    /* Ensure menu icons stay visible when menu is open */
    body.mobile-menu-open .mobile-menu-container .menu-link-icon,
    body.mobile-menu-open .mobile-menu-container .submenu-link-icon,
    body.mobile-menu-open .mobile-menu-container .submenu-toggle,
    body.mobile-menu-open .mobile-menu-container .submenu-toggle i,
    body.mobile-menu-open .mobile-menu-container i {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Ensure close button stays visible */
    body.mobile-menu-open .mobile-menu-close,
    body.mobile-menu-open .mobile-menu-close i {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Lower the main header z-index when mobile menu is open */
    body.mobile-menu-open .header-navigation {
        z-index: 50 !important; /* LOWER than mobile menu */
    }
}

/* ===================================
   MOBILE CONTROLS GROUP
   =================================== */

.mobile-controls-group {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    /* REMOVED all styling - keeping only flex and gap */
}

/* REMOVED hover effects */

/* ===================================
   HAMBURGER BUTTON
   =================================== */

.mobile-menu-toggle {
    position: relative;
    width: auto; /* REMOVED fixed width */
    height: auto; /* REMOVED fixed height */
    background: none; /* REMOVED gradient background */
    border: none; /* REMOVED border */
    border-radius: 0; /* REMOVED border radius */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: visible; /* Changed from hidden */
    padding: 0.5rem; /* Simple padding */
}

.mobile-menu-toggle::before {
    display: none; /* REMOVED shine effect */
}

.mobile-menu-toggle:hover::before {
    display: none;
}

.mobile-menu-toggle:hover {
    background: none; /* REMOVED hover background */
    border-color: transparent;
    transform: none; /* REMOVED scale effect */
    box-shadow: none; /* REMOVED shadow */
}

.mobile-menu-toggle.active {
    background: none; /* REMOVED active background */
    border-color: transparent;
    transform: none; /* REMOVED rotation */
    box-shadow: none; /* REMOVED shadow */
}

/* Hamburger Icon - Clean 3 lines */
.hamburger-icon {
    position: relative;
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: none; /* REMOVED transition */
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px; /* Slightly rounded edges */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===================================
   MOBILE MENU OVERLAY
   =================================== */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9998; /* INCREASED FROM 998 to 9998 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   MOBILE MENU CONTAINER
   =================================== */

.mobile-menu-container {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: linear-gradient(135deg, 
        rgba(26, 26, 53, 0.98) 0%, 
        rgba(30, 42, 74, 0.98) 50%, 
        rgba(59, 107, 181, 0.98) 100%
    );
    backdrop-filter: blur(20px);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    border-left: 2px solid rgba(0, 212, 170, 0.3);
    z-index: 9999; /* INCREASED FROM 999 to 9999 */
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.mobile-menu-container.active {
    right: 0;
}

/* ===================================
   MENU HEADER
   =================================== */

.mobile-menu-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(79, 172, 254, 0.1));
    border-bottom: 2px solid rgba(0, 212, 170, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10000; /* INCREASED to stay above everything */
    backdrop-filter: blur(10px);
}

.mobile-menu-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #00d4aa, #4facfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
    color: #dc3545;
    transform: rotate(90deg);
}

/* ===================================
   MENU NAVIGATION
   =================================== */

.mobile-menu-nav {
    flex: 1;
    padding: 1rem 0;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateX(50px);
    animation: slideInFromRight 0.4s 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; }
.mobile-menu-item:nth-child(8) { animation-delay: 0.45s; }
.mobile-menu-item:nth-child(9) { animation-delay: 0.5s; }
.mobile-menu-item:nth-child(10) { animation-delay: 0.55s; }

@keyframes slideInFromRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Main Menu Link */
.mobile-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border-left: 4px solid transparent; /* Add left border for hover effect */
}

.mobile-menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-link:hover::before,
.mobile-menu-link.active::before {
    opacity: 1;
}

.mobile-menu-link:hover {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.2), rgba(79, 172, 254, 0.1));
    border-left-color: #00d4aa; /* Show left border on hover */
    color: #fff;
    transform: translateX(4px); /* Slight slide effect */
}

.mobile-menu-link.active {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.25), rgba(79, 172, 254, 0.15));
    border-left-color: #00d4aa;
    color: #fff;
}

.menu-link-icon {
    margin-right: 1rem;
    font-size: 1.2rem;
    color: #00d4aa;
    transition: all 0.3s ease;
}

.mobile-menu-link:hover .menu-link-icon {
    transform: scale(1.15) rotate(5deg);
    color: #4facfe; /* Change icon color on hover */
}

.menu-link-text {
    flex: 1;
}

.submenu-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    color: #fff;
    cursor: pointer;
}

.submenu-toggle i {
    transition: transform 0.3s ease;
}

.mobile-menu-item.has-submenu.open .submenu-toggle i {
    transform: rotate(180deg);
}

.mobile-menu-item.has-submenu.open .submenu-toggle {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
}

/* ===================================
   SUBMENU STYLES
   =================================== */

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-item.has-submenu.open .mobile-submenu {
    max-height: 1000px;
}

.mobile-submenu-list {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.mobile-submenu-item {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.mobile-menu-item.has-submenu.open .mobile-submenu-item {
    opacity: 1;
    transform: translateX(0);
}

.mobile-submenu-item:nth-child(1) { transition-delay: 0.1s; }
.mobile-submenu-item:nth-child(2) { transition-delay: 0.15s; }
.mobile-submenu-item:nth-child(3) { transition-delay: 0.2s; }
.mobile-submenu-item:nth-child(4) { transition-delay: 0.25s; }
.mobile-submenu-item:nth-child(5) { transition-delay: 0.3s; }

.mobile-submenu-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem 1rem 3rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    border-left: 3px solid transparent; /* Add left border for submenu items */
}

.mobile-submenu-link::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 50%;
    width: 8px;
    height: 8px;
    background: rgba(0, 212, 170, 0.5);
    border-radius: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.3s ease;
}

.mobile-submenu-link:hover::before {
    transform: translateY(-50%) scale(1);
}

.mobile-submenu-link:hover {
    background: rgba(0, 212, 170, 0.15);
    border-left-color: #00d4aa;
    color: #00d4aa;
    transform: translateX(4px); /* Slight slide effect */
}

.submenu-link-icon {
    margin-right: 0.75rem;
    font-size: 1rem;
    color: #4facfe;
    transition: all 0.3s ease;
}

.mobile-submenu-link:hover .submenu-link-icon {
    transform: scale(1.2);
    color: #00d4aa;
}

/* ===================================
   MENU FOOTER
   =================================== */

.mobile-menu-footer {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2));
    border-top: 2px solid rgba(0, 212, 170, 0.3);
    text-align: center;
}

.menu-footer-text {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0;
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   =================================== */

@media (max-width: 768px) {
    .mobile-controls-group {
        display: flex;
    }
}

@media (max-width: 480px) {
    .mobile-menu-container {
        width: 100%;
        max-width: 100vw;
    }
    
    .mobile-menu-link {
        font-size: 1rem;
        padding: 1rem 1.2rem;
    }
    
    .mobile-submenu-link {
        padding: 0.9rem 1.2rem 0.9rem 2.5rem;
        font-size: 0.9rem;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

.mobile-menu-toggle:focus,
.mobile-menu-close:focus,
.mobile-menu-link:focus,
.mobile-submenu-link:focus,
.submenu-toggle:focus {
    outline: 2px solid #00d4aa;
    outline-offset: 2px;
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* ===================================
   MENU NAVIGATION
   =================================== */

/* Mobile Search Button */
.mobile-menu-search {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.15), rgba(79, 172, 254, 0.15));
    border-bottom: 2px solid rgba(0, 212, 170, 0.3) !important;
    border-left: 4px solid rgba(0, 212, 170, 0.5); /* Always show left border for search */
}

.mobile-search-trigger {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-search-trigger:hover {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.25), rgba(79, 172, 254, 0.2));
    transform: translateX(4px); /* Slight slide effect */
}

.mobile-search-trigger .menu-link-icon {
    color: #00d4aa;
    transition: all 0.3s ease;
}

.mobile-search-trigger:hover .menu-link-icon {
    transform: scale(1.15) rotate(5deg);
    color: #4facfe;
}
