/* ===================================================================== */
/* COMPLETE NAVIGATION CSS - EXTRACTED FROM HOMEPAGE                    */
/* ===================================================================== */
/* This file contains all CSS rules for navigation, menu, dropdown,     */
/* mobile menu, and responsive styles for complete styling independence */
/* ===================================================================== */

/* CSS Variables for Navigation */
:root {
    --text-primary: #1e3a5f;
    --text-secondary: #2d4a66;
    --accent: #007aff;
    --accent-hover: #0051d5;
    --background-secondary: #f8f6f3;
    --shadow-medium: 0 8px 24px rgba(30, 58, 95, 0.12);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================================== */
/* BASE NAVIGATION STYLES                                               */
/* ===================================================================== */

/* Main Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Navigation Container */
.nav-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 44px;
}

/* Logo Styling */
.logo {
    display: flex;
    align-items: center;
    min-height: 46px;
}

.logo h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.logo-image {
    height: 42px;
    width: auto;
    max-width: 200px;
    transition: all 0.3s ease;
    margin: 2px 0;
}

.logo-image:hover {
    transform: scale(1.05);
}

/* ===================================================================== */
/* DESKTOP NAVIGATION STYLES                                            */
/* ===================================================================== */

/* Main Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 32px;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

/* Navigation Links */
.nav-menu a {
    color: #1d1d1f;
    font-weight: 400;
    font-size: 0.875rem;
    padding: 8px 0;
    transition: all 0.2s ease;
    opacity: 0.8;
    text-decoration: none;
    display: inline-block;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #007aff;
    opacity: 1;
}

/* ===================================================================== */
/* DESKTOP DROPDOWN STYLES                                              */
/* ===================================================================== */

/* Desktop Dropdown Container */
@media (min-width: 769px) {
    .dropdown {
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .dropdown > a {
        color: #1d1d1f;
        font-weight: 400;
        font-size: 0.875rem;
        padding: 8px 4px;
        transition: all 0.2s ease;
        opacity: 0.8;
        text-decoration: none;
        cursor: pointer;
        z-index: 1000;
        position: relative;
        pointer-events: auto;
        display: inline-block;
    }
    
    .dropdown > a:hover {
        opacity: 1;
        color: #007aff;
    }
    
    /* Hide dropdown wrapper on desktop */
    .dropdown-wrapper {
        display: none;
    }
    
    /* Hide dropdown toggle arrow on desktop */
    .dropdown-toggle {
        display: none;
    }
    
    /* Desktop Dropdown Content */
    .dropdown-content {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(30, 58, 95, 0.12);
        min-width: 200px;
        margin-top: 0;
        padding: 8px;
        display: none;
        opacity: 0;
        visibility: hidden;
        z-index: 999;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    /* Create invisible bridge to maintain hover */
    .dropdown-content::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 0;
        right: 0;
        height: 8px;
        background: transparent;
    }
    
    /* Show dropdown on hover */
    .dropdown:hover .dropdown-content,
    .dropdown-content:hover {
        display: block;
        opacity: 1;
        visibility: visible;
    }
    
    /* Dropdown Links */
    .dropdown-content a {
        display: block;
        padding: 10px 16px;
        color: var(--text-primary);
        font-size: 0.875rem;
        transition: all 0.2s ease;
        border-radius: 8px;
        margin: 2px 0;
        text-decoration: none;
    }
    
    .dropdown-content a:hover {
        background: var(--background-secondary);
        color: var(--accent);
    }
}

/* ===================================================================== */
/* MOBILE MENU TOGGLE STYLES                                            */
/* ===================================================================== */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    gap: 4px;
    order: 3;
    background: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: #1d1d1f;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

/* Mobile Menu Toggle Animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Remove focus outline */
.mobile-menu-toggle:focus {
    outline: none !important;
}

/* ===================================================================== */
/* CTA BUTTON STYLES                                                    */
/* ===================================================================== */

/* Call-to-Action Button */
.cta-button {
    display: flex;
    align-items: center;
}

.btn-primary {
    background: #007aff;
    color: white;
    padding: 8px 20px;
    border-radius: 22px;
    font-weight: 400;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    letter-spacing: -0.022em;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.btn-primary:hover {
    background: #0051d5;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
    color: white;
}

/* ===================================================================== */
/* MOBILE RESPONSIVE STYLES                                             */
/* ===================================================================== */

@media (max-width: 768px) {
    /* Navigation Container Mobile */
    .navbar {
        padding: 8px 16px;
    }
    
    .nav-container {
        justify-content: space-between;
        padding: 0 16px;
        position: relative;
        z-index: 1001;
    }
    
    /* Logo Mobile */
    .logo-image {
        height: 43px;
        max-width: 150px;
    }
    
    /* Show Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        padding: 10px;
        gap: 5px;
        position: relative;
        z-index: 1002;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 1.5px;
        background: #1d1d1f;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 1px;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }
    
    /* Mobile Navigation Menu */
    .nav-menu {
        position: fixed;
        top: 44px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 44px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 20px;
        opacity: 1;
        visibility: hidden;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
        z-index: 9999;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        gap: 0;
        margin: 0;
        list-style: none;
    }
    
    /* Show menu when active */
    .nav-menu.active {
        left: 0 !important;
        visibility: visible !important;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        display: block;
        padding: 18px 0;
        font-size: 17px;
        font-weight: 400;
        color: #1d1d1f;
        opacity: 1;
        transition: background 0.2s ease, color 0.2s ease;
        text-align: center;
        text-decoration: none;
    }
    
    .nav-menu a:active {
        background: rgba(0, 122, 255, 0.1);
        color: #007aff;
    }
    
    /* ================================================================= */
    /* MOBILE DROPDOWN STYLES WITH SMOOTH ARROW                         */
    /* ================================================================= */
    
    /* Mobile Dropdown Container */
    .dropdown {
        position: relative;
        display: block;
        width: 100%;
    }
    
    /* Services link */
    .dropdown > a {
        display: inline-block !important;
        text-align: center !important;
        padding: 18px 0 !important;
        color: #1d1d1f !important;
        font-size: 17px !important;
        font-weight: 400 !important;
        transition: color 0.2s ease !important;
        text-decoration: none !important;
        width: calc(100% - 50px) !important;
    }
    
    /* Mobile Dropdown Wrapper */
    .dropdown-wrapper {
        display: inline-block;
        position: absolute;
        right: 20px;
        top: 18px;
        z-index: 1001;
    }
    
    /* Mobile Dropdown Toggle Button with smooth animation */
    .dropdown-toggle {
        background: none;
        border: none;
        color: #86868b;
        font-size: 14px;
        padding: 18px 10px;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: block;
        position: relative;
        z-index: 1002;
        outline: none !important;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
        transform-origin: center;
    }
    
    /* Remove focus outline and add subtle effect */
    .dropdown-toggle:focus {
        outline: none !important;
        box-shadow: none !important;
    }
    
    .dropdown-toggle:active {
        outline: none !important;
        background: rgba(0, 122, 255, 0.05);
        border-radius: 50%;
    }
    
    .dropdown-toggle:active .arrow-icon {
        transform: scale(0.9);
    }
    
    /* Arrow icon styling */
    .dropdown-toggle .arrow-icon {
        display: inline-block;
        font-size: 16px;
        line-height: 1;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
    }
    
    /* Smooth rotation when active */
    .dropdown.mobile-active .dropdown-toggle {
        color: #007aff;
    }
    
    .dropdown.mobile-active .dropdown-toggle .arrow-icon {
        transform: rotate(180deg);
    }
    
    /* Hover state for better UX */
    @media (hover: hover) {
        .dropdown-toggle:hover {
            color: #007aff;
            opacity: 0.8;
        }
    }
    
    /* Mobile Dropdown Content with smooth animation */
    .dropdown-content {
        background: rgba(248, 246, 243, 0.95);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 0 0 8px 8px;
        padding: 0;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                    opacity 0.25s ease,
                    visibility 0.25s ease,
                    padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        z-index: 999;
        pointer-events: none;
        transform: translateY(-5px);
    }
    
    .dropdown.mobile-active .dropdown-content {
        max-height: 300px !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding: 8px 0 !important;
        display: block !important;
        overflow: visible !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.25s ease,
                    visibility 0.25s ease,
                    padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.25s ease !important;
    }
    
    /* Mobile Dropdown Links */
    .dropdown-content a {
        display: block !important;
        padding: 12px 20px 12px 40px !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        color: #1d1d1f !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        text-align: left !important;
        text-decoration: none !important;
        transition: background-color 0.2s ease, color 0.2s ease !important;
        background: transparent !important;
        min-height: 40px !important;
        line-height: 1.4 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .dropdown-content a:last-child {
        border-bottom: none;
    }
    
    .dropdown-content a:active,
    .dropdown-content a:hover {
        background: rgba(0, 122, 255, 0.08) !important;
        color: #007aff !important;
    }
    
    /* Hide CTA Button on Mobile */
    .cta-button {
        display: none;
    }
}

/* ===================================================================== */
/* SMALL MOBILE ADJUSTMENTS (480px and below)                          */
/* ===================================================================== */

@media (max-width: 480px) {
    .logo-image {
        height: 29px;
        max-width: 100px;
    }
}

@media (max-width: 375px) {
    .nav-menu {
        padding: 80px 16px 30px;
    }
    
    .nav-menu a {
        font-size: 16px;
        padding: 16px 0;
    }
    
    .dropdown-content a {
        font-size: 15px !important;
        padding: 14px 0 14px 24px !important;
        min-height: 48px;
    }
    
    .mobile-menu-toggle {
        padding: 8px;
    }
}