/**
 * Mobile Navigation Menu - Styles
 * Lisenziya.az - Mobile-First Redesign
 * Author: AI Assistant
 * Date: 2026-01-18
 * 
 * Components:
 * 1. Hamburger Button
 * 2. Overlay Menu
 * 3. Backdrop
 * 4. Menu Items & Submenus
 * 5. WhatsApp Sticky Button
 * 6. Animations
 */

/* ========== HAMBURGER BUTTON ========== */
.mobile-menu-hamburger {
    display: flex !important; /* Show on all screens */
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 10000;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: #fff;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.mobile-menu-hamburger:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.mobile-menu-hamburger:hover .hamburger-line {
    background: #fff;
}

.mobile-menu-hamburger:active {
    transform: scale(0.95);
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #667eea;
    border-radius: 2px;
    transition: all 0.3s ease;
    margin: 3px 0;
}

.mobile-menu-hamburger.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.mobile-menu-hamburger.active .hamburger-line {
    background: #fff;
}

.mobile-menu-hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

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

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

/* ========== BACKDROP ========== */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9997;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ========== OVERLAY MENU ========== */
.mobile-menu-overlay {
    /* Header section styling */
}

.mobile-menu-top-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    padding: 0 20px;
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-logo svg,
.mobile-menu-logo img {
    max-height: 50px;
    width: auto;
}

.mobile-menu-language {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-language .btn-group,
.mobile-menu-language form {
    margin: 0;
}

.mobile-menu-language .btn-link {
    color: #333;
    font-size: 14px;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.mobile-menu-language .btn-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: #667eea;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: #fff;
    z-index: 9998;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 16px rgba(0,0,0,0.2);
}

.mobile-menu-overlay.active {
    left: 0;
}

/* ========== MENU HEADER ========== */
.mobile-menu-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    position: absolute;
    top: 20px;
    right: 20px;
}
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.mobile-menu-close:active {
    transform: rotate(90deg) scale(0.9);
}

/* Logo and Language in Menu Header */
.mobile-menu-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.mobile-menu-logo a {
    display: block;
}

.mobile-menu-logo svg,
.mobile-menu-logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

.mobile-menu-language {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-language .language {
    width: 100%;
    display: flex;
    justify-content: center;
}

.mobile-menu-language .btn-group {
    width: auto;
    position: relative;
}

.mobile-menu-language .btn-link {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
}

.mobile-menu-language .btn-link img {
    width: 20px;
    height: auto;
    border-radius: 3px;
}

.mobile-menu-language .btn-link .fa {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.mobile-menu-language .btn-group.open .btn-link .fa {
    transform: rotate(180deg);
}

.mobile-menu-language .btn-link:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.mobile-menu-language .dropdown-menu {
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    margin-top: 5px !important;
    min-width: 150px !important;
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 1000 !important;
    padding: 5px 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.mobile-menu-language .btn-group.open .dropdown-menu {
    display: block !important;
}

.mobile-menu-language .dropdown-menu li {
    list-style: none;
}

.mobile-menu-language .dropdown-menu li a {
    color: #333 !important;
    padding: 10px 15px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: all 0.2s ease !important;
}

.mobile-menu-language .dropdown-menu li a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
}

.mobile-menu-language .dropdown-menu li a img {
    width: 18px;
    height: auto;
}

/* ========== NAVIGATION ========== */
.mobile-menu-nav {
    padding: 10px 0;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-item {
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    font-family: 'Barlow', sans-serif;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-menu-link:hover {
    background: #f8f9fa;
    color: #667eea;
}

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

.mobile-menu-icon {
    font-size: 24px;
    margin-right: 15px;
    min-width: 30px;
    text-align: center;
}

.mobile-menu-text {
    flex: 1;
}

.mobile-menu-item-toggle {
    font-size: 24px;
    color: #999;
    transition: transform 0.3s ease;
    cursor: pointer;
    padding: 5px 10px;
    margin-right: -10px;
}

.mobile-menu-item-toggle.active {
    transform: rotate(90deg);
    color: #667eea;
}

/* ========== SUBMENU ========== */
.mobile-menu-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu-submenu.active {
    max-height: 500px;
}

.mobile-menu-subitem {
    border-bottom: 1px solid #e9ecef;
}

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

.mobile-menu-sublink {
    display: block;
    padding: 14px 20px 14px 65px;
    color: #555;
    text-decoration: none;
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    transition: all 0.2s ease;
}

.mobile-menu-sublink:hover {
    background: #fff;
    color: #667eea;
    padding-left: 70px;
}

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

/* ========== WHATSAPP STICKY BUTTON ========== */
.whatsapp-sticky {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9996;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
    animation: whatsappPulse 2s infinite;
}

.whatsapp-sticky:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-sticky:active {
    transform: scale(0.95);
}

.whatsapp-icon {
    width: 32px;
    height: 32px;
    fill: #fff;
}

.whatsapp-sticky svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

@keyframes whatsappPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.7);
    }
}

/* ========== BODY LOCK ========== */
body.mobile-menu-open {
    overflow: hidden !important;
}

/* ========== RESPONSIVE ========== */

/* ALL SCREENS - Show hamburger, hide header elements */
.mobile-menu-hamburger {
    display: flex !important;
}

.header-top-bar,
header .header-top-bar,
#logo,
#language-switcher {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
}

#menu.navbar,
.navbar-ex1-collapse,
.navbar-toggle {
    display: none !important;
}

@media screen and (max-width: 768px) {
    /* Mobile specific adjustments */
    .mobile-menu-overlay {
        width: 85%;
        max-width: 400px;
    }
}

@media screen and (max-width: 480px) {
    .mobile-menu-overlay {
        width: 90%;
    }
    
    .mobile-menu-hamburger {
        top: 12px;
        left: 12px;
        width: 42px;
        height: 42px;
    }
    
    .hamburger-line {
        width: 22px;
    }
    
    .whatsapp-sticky {
        width: 56px;
        height: 56px;
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-sticky svg {
        width: 28px;
        height: 28px;
    }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu-overlay,
    .mobile-menu-backdrop,
    .hamburger-line,
    .mobile-menu-link,
    .mobile-menu-submenu,
    .whatsapp-sticky {
        transition: none;
        animation: none;
    }
}

/* Focus states for keyboard navigation */
.mobile-menu-hamburger:focus,
.mobile-menu-close:focus,
.mobile-menu-link:focus,
.mobile-menu-sublink:focus,
.whatsapp-sticky:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mobile-menu-overlay {
        border: 2px solid #000;
    }
    
    .mobile-menu-item {
        border-bottom-width: 2px;
    }
}
