/*
 * Navigation Styles
 * Loaded AFTER mmenu-light.css to override library defaults
 *
 * Structure:
 * 1. BASE STYLES (shared across desktop and mobile)
 * 2. DESKTOP STYLES (min-width: 769px)
 * 3. MOBILE STYLES (max-width: 768px)
 */

/* ============================================
   1. BASE NAVIGATION STYLES
   (Shared across desktop and mobile)
   ============================================ */

.navbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-brand svg {
    color: var(--primary-color);
}

/* Hamburger Toggle Button (base styles) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.nav-toggle span {
    width: 2rem;
    height: 3px;
    background: var(--text-medium);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.nav-toggle.active span:first-child {
    transform: rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* ============================================
   2. DESKTOP NAVIGATION STYLES
   (min-width: 769px)
   ============================================ */

@media (min-width: 769px) {
    /* Hide hamburger on desktop */
    .nav-toggle {
        display: none !important;
    }

    /* Show menu as horizontal navigation */
    #mobile-menu {
        display: flex !important;
        position: static !important;
        transform: none !important;
        height: auto !important;
        width: auto !important;
        padding: 0 !important;
        background: transparent !important;
    }

    #mobile-menu ul {
        display: flex !important;
        flex-direction: row !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 2rem !important;
        align-items: center !important;
    }

    #mobile-menu ul li {
        margin: 0 !important;
        position: relative;
    }

    /* Desktop nav links */
    #mobile-menu ul li > a {
        text-decoration: none !important;
        color: var(--text-medium) !important;
        font-weight: 500 !important;
        font-size: 0.95rem !important;
        transition: color 0.2s !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.25rem !important;
        padding: 0 !important;
        white-space: nowrap !important;
    }

    #mobile-menu ul li > a:hover {
        color: var(--primary-color) !important;
    }

    /* Desktop button: Book a Call */
    #mobile-menu ul li > a.btn-primary-small {
        background: var(--gradient-2) !important;
        color: #ffffff !important;
        padding: 0.65rem 1.25rem !important;
        border-radius: 0.5rem !important;
        font-weight: 700 !important;
        font-size: 0.9rem !important;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
        transition: transform 0.2s, box-shadow 0.2s, background 0.2s !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    #mobile-menu ul li > a.btn-primary-small:hover {
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5) !important;
        background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%) !important;
        transform: translateY(-3px) !important;
    }

    /* Desktop button: Sign In */
    #mobile-menu ul li > a.btn-secondary-small {
        background: white !important;
        color: var(--primary-color) !important;
        padding: 0.65rem 1.25rem !important;
        border-radius: 0.5rem !important;
        font-weight: 600 !important;
        font-size: 0.9rem !important;
        border: 2px solid var(--primary-color) !important;
        transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    #mobile-menu ul li > a.btn-secondary-small:hover {
        border-color: var(--primary-dark) !important;
        background: var(--background-light) !important;
        transform: translateY(-3px) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    }

    /* Desktop dropdown arrow */
    #mobile-menu ul li > a .dropdown-arrow {
        font-size: 0.7rem !important;
        transition: transform 0.2s !important;
        display: inline-block !important;
        margin-left: 0.25rem !important;
    }

    #mobile-menu ul li:hover > a .dropdown-arrow {
        transform: rotate(180deg) !important;
    }

    /* Desktop dropdown menu */
    #mobile-menu ul li ul {
        display: none !important;
        position: absolute !important;
        top: calc(100% + 0.75rem) !important;
        left: 0 !important;
        background: white !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 0.5rem !important;
        box-shadow: var(--shadow-lg) !important;
        min-width: 200px !important;
        padding: 0.5rem 0 !important;
        z-index: 1000 !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    #mobile-menu ul li:hover > ul {
        display: block !important;
    }

    /* Invisible bridge to prevent gap issues */
    #mobile-menu ul li::before {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 0.5rem;
        background: transparent;
        z-index: 999;
    }

    #mobile-menu ul li ul li {
        margin: 0 !important;
    }

    #mobile-menu ul li ul li a {
        display: block !important;
        padding: 0.75rem 1.5rem !important;
        color: var(--text-medium) !important;
        text-decoration: none !important;
        font-size: 0.95rem !important;
        transition: background 0.2s, color 0.2s !important;
    }

    #mobile-menu ul li ul li a:hover {
        background: var(--background-light) !important;
        color: var(--primary-color) !important;
    }

    /* Hide mmenu-light offcanvas on desktop */
    .mm-wrapper__blocker,
    .mm-wrapper__drawer {
        display: none !important;
    }
}

/* ============================================
   3. MOBILE NAVIGATION STYLES
   (max-width: 768px)
   ============================================ */

@media (max-width: 768px) {
    /* Show hamburger button */
    .nav-toggle {
        display: flex;
        position: relative;
        z-index: 1002;
    }

    /* Hide dropdown arrow in source menu (mobile doesn't use dropdowns) */
    #mobile-menu .dropdown-arrow {
        display: none !important;
    }

    /* mmenu-light menu visibility */
    .mm-menu {
        display: block !important;
        visibility: visible !important;
    }

    .mm-menu__navbar,
    .mm-menu__panels,
    .mm-menu__panels > .mm-panel {
        display: block !important;
        visibility: visible !important;
    }

    .mm-menu ul,
    .mm-menu ul li,
    .mm-menu ul li a {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Hide dropdown arrow in mobile menu (mmenu-light handles submenus) */
    .mm-menu .dropdown-arrow {
        display: none !important;
    }

    /* Mobile: Regular menu items (not buttons) */
    .mm-menu a:not(.btn-primary-small):not(.btn-secondary-small) {
        padding: 0.75rem 1.5rem !important;
        color: var(--text-medium) !important;
        text-decoration: none !important;
        font-weight: 500 !important;
        font-size: 0.95rem !important;
    }

    .mm-menu a:not(.btn-primary-small):not(.btn-secondary-small):hover {
        background: var(--background-light) !important;
        color: var(--primary-color) !important;
    }

    /* Mobile: Book a Call button - override mmenu-light defaults */
    .mm-menu a.btn-primary-small,
    .mm-menu .mm-panel a.btn-primary-small,
    .mm-menu .mm-listview a.btn-primary-small,
    .mm-menu li a.btn-primary-small,
    .mm-menu .mm-listview__item a.btn-primary-small {
        background: linear-gradient(135deg, #2563eb 0%, #8b5cf6 100%) !important;
        background-color: transparent !important;
        background-image: linear-gradient(135deg, #2563eb 0%, #8b5cf6 100%) !important;
        color: #ffffff !important;
        border: none !important;
        border-width: 0 !important;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
        padding: 0.75rem 1.5rem !important;
        font-weight: 700 !important;
        font-size: 0.9rem !important;
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        border-radius: 0.5rem !important;
        transition: none !important;
        transition-duration: 0s !important;
        transition-property: none !important;
        text-shadow: none !important;
    }

    /* Mobile: Sign In button - override mmenu-light defaults */
    .mm-menu a.btn-secondary-small,
    .mm-menu .mm-panel a.btn-secondary-small,
    .mm-menu .mm-listview a.btn-secondary-small,
    .mm-menu li a.btn-secondary-small,
    .mm-menu .mm-listview__item a.btn-secondary-small {
        background: white !important;
        background-color: white !important;
        background-image: none !important;
        color: var(--primary-color) !important;
        border: 2px solid var(--primary-color) !important;
        border-width: 2px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        padding: 0.75rem 1.5rem !important;
        font-weight: 700 !important;
        font-size: 0.9rem !important;
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        border-radius: 0.5rem !important;
        transition: none !important;
        transition-duration: 0s !important;
        transition-property: none !important;
        text-shadow: none !important;
    }

    /* Mobile: Remove ALL hover effects for buttons */
    .mm-menu a.btn-primary-small:hover,
    .mm-menu a.btn-primary-small:active,
    .mm-menu a.btn-primary-small:focus,
    .mm-menu .mm-panel a.btn-primary-small:hover,
    .mm-menu .mm-panel a.btn-primary-small:active,
    .mm-menu .mm-panel a.btn-primary-small:focus,
    .mm-menu .mm-listview a.btn-primary-small:hover,
    .mm-menu .mm-listview a.btn-primary-small:active,
    .mm-menu .mm-listview a.btn-primary-small:focus,
    .mm-menu li a.btn-primary-small:hover,
    .mm-menu li a.btn-primary-small:active,
    .mm-menu li a.btn-primary-small:focus,
    .mm-menu .mm-listview__item a.btn-primary-small:hover,
    .mm-menu .mm-listview__item a.btn-primary-small:active,
    .mm-menu .mm-listview__item a.btn-primary-small:focus {
        background: linear-gradient(135deg, #2563eb 0%, #8b5cf6 100%) !important;
        background-color: transparent !important;
        background-image: linear-gradient(135deg, #2563eb 0%, #8b5cf6 100%) !important;
        color: #ffffff !important;
        transform: none !important;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
        text-shadow: none !important;
    }

    .mm-menu a.btn-secondary-small:hover,
    .mm-menu a.btn-secondary-small:active,
    .mm-menu a.btn-secondary-small:focus,
    .mm-menu .mm-panel a.btn-secondary-small:hover,
    .mm-menu .mm-panel a.btn-secondary-small:active,
    .mm-menu .mm-panel a.btn-secondary-small:focus,
    .mm-menu .mm-listview a.btn-secondary-small:hover,
    .mm-menu .mm-listview a.btn-secondary-small:active,
    .mm-menu .mm-listview a.btn-secondary-small:focus,
    .mm-menu li a.btn-secondary-small:hover,
    .mm-menu li a.btn-secondary-small:active,
    .mm-menu li a.btn-secondary-small:focus,
    .mm-menu .mm-listview__item a.btn-secondary-small:hover,
    .mm-menu .mm-listview__item a.btn-secondary-small:active,
    .mm-menu .mm-listview__item a.btn-secondary-small:focus {
        background: white !important;
        background-color: white !important;
        background-image: none !important;
        color: var(--primary-color) !important;
        border-color: var(--primary-color) !important;
        transform: none !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        text-shadow: none !important;
    }
}
