/**
 * Modern Menu Styles - Desktop & Mobile
 * Lisenziya.az Professional Design
 * Date: 2026-01-18
 */

/* ========== DESKTOP MENU MODERN DESIGN ========== */
#menu.navbar {
    display: none !important;
}

#menu .nav > li {
    position: relative;
    margin: 0;
    list-style: none;
}

#menu .nav > li > a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: none;
    background: transparent;
    border: none;
    transition: all 0.3s ease;
    position: relative;
}

#menu .nav > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: #fff;
    border-radius: 3px 3px 0 0;
    transition: transform 0.3s ease;
}

#menu .nav > li > a:hover,
#menu .nav > li.open > a,
#menu .nav > li.active > a {
    background: rgba(255,255,255,0.15);
}

#menu .nav > li > a:hover::after,
#menu .nav > li.open > a::after,
#menu .nav > li.active > a::after {
    transform: translateX(-50%) scaleX(1);
}

/* Dropdown Arrow */
#menu .nav > li.dropdown > a::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #fff;
    margin-left: 8px;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

#menu .nav > li.dropdown.open > a::before,
#menu .nav > li.dropdown:hover > a::before {
    transform: rotate(180deg);
}

/* ========== DROPDOWN MENU ========== */
#menu .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    min-width: 280px;
    background: #fff;
    border: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 15px 0;
    margin: 0;
    z-index: 1000;
    animation: dropdownFadeIn 0.3s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#menu .dropdown:hover .dropdown-menu {
    display: block;
}

#menu .dropdown-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 15px;
}

#menu .dropdown-inner ul {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 200px;
    flex: 1;
}

#menu .dropdown-inner ul li {
    margin: 0;
    padding: 0;
}

#menu .dropdown-inner ul li a {
    display: block;
    padding: 10px 15px;
    color: #333;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

#menu .dropdown-inner ul li a::before {
    content: '›';
    position: absolute;
    left: 0;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    color: #667eea;
    font-weight: bold;
}

#menu .dropdown-inner ul li a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding-left: 25px;
    transform: translateX(5px);
}

#menu .dropdown-inner ul li a:hover::before {
    opacity: 1;
    transform: translateX(10px);
}

/* See All Link */
#menu .see-all {
    display: block;
    text-align: center;
    padding: 12px 20px;
    margin: 15px 15px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

#menu .see-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========== MOBILE OPTIMIZATIONS ========== */
@media (max-width: 991px) {
    .navbar-container {
        padding: 0 15px;
    }
    
    #menu #logo svg,
    #menu #logo img {
        height: 35px;
    }
    
    #menu .nav > li > a {
        padding: 12px 15px;
        font-size: 14px;
    }
}

@media (max-width: 767px) {
    /* Hide desktop menu on mobile - show hamburger instead */
    #menu.navbar {
        display: none !important;
    }
}

/* ========== MOBILE BURGER MENU REDESIGN ========== */
@media (max-width: 768px) {
    .mobile-menu-hamburger {
        display: flex !important;
    }
}

/* Enhanced Mobile Menu Overlay */
.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 24px rgba(0,0,0,0.2);
}

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

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    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-logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.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;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Mobile Menu 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: 600;
    transition: all 0.2s ease;
    position: relative;
}

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

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

.mobile-menu-text {
    flex: 1;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

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

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

/* Mobile 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: 1000px;
}

.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;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-menu-sublink::before {
    content: '→';
    position: absolute;
    left: 45px;
    opacity: 0;
    transition: all 0.2s ease;
    color: #667eea;
}

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

.mobile-menu-sublink:hover::before {
    opacity: 1;
    left: 50px;
}

/* ========== ANIMATION & TRANSITIONS ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== FOCUS STATES (ACCESSIBILITY) ========== */
#menu .nav > li > a:focus,
#menu .dropdown-inner a:focus,
#menu .see-all:focus,
.mobile-menu-link:focus,
.mobile-menu-sublink:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ========== HIGH CONTRAST MODE ========== */
@media (prefers-contrast: high) {
    #menu .dropdown-menu {
        border: 2px solid #000;
    }
    
    #menu .dropdown-inner ul li a:hover {
        border: 2px solid #fff;
    }
}
