/* ==========================================================================
   Orbytes Global - Modern Enterprise Navigation Bar Styles
   ========================================================================== */

:root {
    --primary-blue: #0052cc;
    --primary-blue-hover: #0747a6;
    --primary-blue-light: #f0f6ff;
    --primary-blue-border: #bfdbfe;
    --dark-blue: #091e42;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --nav-height: 80px;
    --nav-height-scrolled: 68px;
    --nav-bg: rgba(255, 255, 255, 0.88);
    --nav-bg-scrolled: rgba(255, 255, 255, 0.98);
    --nav-border: rgba(9, 30, 66, 0.08);
    --nav-shadow: 0 4px 20px -2px rgba(9, 30, 66, 0.06);
    --nav-shadow-scrolled: 0 12px 30px -4px rgba(9, 30, 66, 0.12);
}

/* --------------------------------------------------------------------------
   Main Navbar Container
   -------------------------------------------------------------------------- */
#site-navbar {
    min-height: var(--nav-height);
    display: block;
    width: 100%;
}

.main-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--nav-shadow);
    z-index: 10000;
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                background-color 0.3s ease, 
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.main-navbar.scrolled {
    height: var(--nav-height-scrolled);
    background: var(--nav-bg-scrolled);
    box-shadow: var(--nav-shadow-scrolled);
    border-bottom-color: rgba(9, 30, 66, 0.12);
}

.nav-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --------------------------------------------------------------------------
   Brand Logo
   -------------------------------------------------------------------------- */
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 56px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
    transition: height 0.3s ease, transform 0.25s ease;
}

.main-navbar.scrolled .logo img {
    height: 48px;
}

.logo a:hover img {
    transform: scale(1.02);
}

/* --------------------------------------------------------------------------
   Navigation Links (Desktop)
   -------------------------------------------------------------------------- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
    list-style: none;
    padding: 8px 0;
}

/* Hover Bridge: prevents menu closing when cursor moves between link and dropdown */
.nav-item::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 18px;
    background: transparent;
    pointer-events: auto;
}

.nav-link {
    color: var(--dark-blue);
    font-size: 0.94rem;
    font-weight: 550;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-item.active > .nav-link,
.nav-item.current-section > .nav-link {
    color: var(--primary-blue);
    background-color: var(--primary-blue-light);
}

.nav-link i.fa-chevron-down {
    font-size: 0.72rem;
    opacity: 0.7;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.nav-item:hover > .nav-link i.fa-chevron-down,
.nav-item.active > .nav-link i.fa-chevron-down {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--primary-blue);
}

/* --------------------------------------------------------------------------
   High-Converting Contact CTA Button
   -------------------------------------------------------------------------- */
.nav-link.contact-btn {
    background: linear-gradient(135deg, #0052cc 0%, #0077ff 100%);
    color: #ffffff !important;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 9999px;
    box-shadow: 0 4px 14px rgba(0, 82, 204, 0.25);
    margin-left: 10px;
    transition: all 0.25s ease;
}

.nav-link.contact-btn i {
    color: #ffffff !important;
    font-size: 0.82rem;
    transition: transform 0.25s ease;
}

.nav-link.contact-btn:hover {
    background: linear-gradient(135deg, #0747a6 0%, #0066ee 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 82, 204, 0.4);
}

.nav-link.contact-btn:hover i {
    transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Desktop Mega Menu / Dropdowns
   -------------------------------------------------------------------------- */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #ffffff;
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 20px 40px -10px rgba(9, 30, 66, 0.16), 0 0 0 1px rgba(9, 30, 66, 0.06);
    border-top: 3px solid var(--primary-blue);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    max-height: none;
    overflow: visible;
    z-index: 1001;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.22s;
}

/* Show mega menu on hover or focus */
.nav-item:hover > .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Dropdown Widths */
.nav-item:nth-child(1) .dropdown-menu {
    min-width: 960px;
    max-width: 1080px;
}

.nav-item:nth-child(2) .dropdown-menu {
    min-width: 960px;
    max-width: 1080px;
}

.nav-item:nth-child(3) .dropdown-menu,
.dropdown-menu.company-dropdown {
    min-width: 680px;
    max-width: 760px;
}

/* Dropdown Header */
.dropdown-header {
    text-align: left;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.dropdown-header h2 {
    color: var(--dark-blue);
    font-size: 1.18rem;
    font-weight: 700;
    margin: 0 0 3px;
    letter-spacing: -0.01em;
}

.dropdown-header p {
    color: var(--text-muted);
    font-size: 0.84rem;
    margin: 0;
}

/* Dropdown Grid */
.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.nav-item:nth-child(3) .dropdown-grid,
.company-dropdown .dropdown-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Dropdown Section */
.dropdown-section h3 {
    color: var(--primary-blue);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1.5px solid rgba(0, 82, 204, 0.15);
}

.dropdown-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-section ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
    padding: 7px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.18s ease;
}

.dropdown-section ul li a i {
    color: var(--primary-blue);
    width: 18px;
    text-align: center;
    font-size: 0.88rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.dropdown-section ul li a:hover {
    color: var(--primary-blue);
    background-color: var(--primary-blue-light);
    transform: translateX(4px);
}

.dropdown-section ul li a:hover i {
    transform: scale(1.15);
}

.dropdown-section ul li a.current-page {
    color: var(--primary-blue);
    background-color: var(--primary-blue-light);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Hamburger Button
   -------------------------------------------------------------------------- */
.hamburger,
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    color: var(--dark-blue);
    transition: all 0.25s ease;
    margin-left: auto;
    z-index: 1005 !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

.hamburger:hover,
.mobile-menu-btn:hover {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

.hamburger.active,
.mobile-menu-btn.active {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   Backdrop Overlay for Mobile Drawer
   -------------------------------------------------------------------------- */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 30, 66, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9990 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    touch-action: manipulation;
}

.nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}

body.nav-open,
html.nav-open {
    overflow: hidden !important;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoint: Laptops & Medium Screens (1025px - 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) and (min-width: 1025px) {
    .nav-item:nth-child(1) .dropdown-menu,
    .nav-item:nth-child(2) .dropdown-menu {
        min-width: 820px;
        max-width: 900px;
        padding: 20px 22px;
    }
    
    .nav-item:nth-child(3) .dropdown-menu,
    .dropdown-menu.company-dropdown {
        min-width: 580px;
    }

    .dropdown-grid {
        gap: 16px;
    }
}

/* --------------------------------------------------------------------------
   Responsive Breakpoint: Mobile & Tablet Drawer (<= 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .main-navbar {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: #ffffff !important;
        z-index: 10000 !important;
    }

    .nav-container {
        padding: 0 20px;
    }

    .hamburger,
    .mobile-menu-btn {
        display: flex;
    }

    /* Off-Canvas Slide Drawer */
    .nav-links {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        width: 320px;
        max-width: 85vw;
        height: 100%;
        height: 100dvh;
        background: #ffffff;
        z-index: 1004 !important;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 85px 20px 35px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: -10px 0 35px rgba(9, 30, 66, 0.18);
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.34s ease;
        gap: 0;
    }

    .nav-links.active {
        transform: translateX(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .nav-item {
        width: 100%;
        padding: 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-item::after {
        display: none;
    }

    .nav-link {
        width: 100%;
        padding: 14px 10px;
        font-size: 0.98rem;
        justify-content: space-between;
        border-radius: 8px;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Prevent sticky mobile hover from rotating chevron when closed */
    .nav-item:hover > .nav-link i.fa-chevron-down {
        transform: none;
    }

    .nav-item.active > .nav-link i.fa-chevron-down {
        transform: rotate(180deg) !important;
        color: var(--primary-blue) !important;
    }

    /* Accordion Dropdown on Mobile */
    .dropdown-menu {
        position: static;
        width: 100%;
        min-width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        overflow-y: visible !important;
        transform: none !important;
        box-shadow: none;
        border-radius: 10px;
        border: none;
        border-left: 3px solid var(--primary-blue);
        background: #f8fafc;
        padding: 12px 14px;
        margin: 2px 0 12px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        display: none !important;
    }

    .nav-item.active > .dropdown-menu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        animation: fadeInSlide 0.25s ease forwards;
    }

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

    .dropdown-header {
        display: none; /* Hidden on mobile to save vertical space */
    }

    .dropdown-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
        max-height: none !important;
        overflow: visible !important;
        overflow-y: visible !important;
    }

    .dropdown-section h3 {
        font-size: 0.72rem;
        margin-bottom: 6px;
        padding-bottom: 4px;
    }

    .dropdown-section ul li a {
        padding: 6px 8px;
        font-size: 0.85rem;
    }

    /* Mobile Contact Button */
    .nav-link.contact-btn {
        margin: 18px 0 0;
        width: 100%;
        justify-content: center;
        border-radius: 12px;
        padding: 12px;
    }
}

/* --------------------------------------------------------------------------
   Mobile Phones (<= 768px): Fluid Logo Sizing (No Squishing!)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
    }

    .logo img {
        height: 48px;
        width: auto;
        max-width: 160px;
        object-fit: contain;
    }

    .main-navbar.scrolled .logo img {
        height: 42px;
    }
}
