/* Global Transparent Header Styles */

/* Transparent Header - applies to all pages */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background: transparent;
    transition: all 0.4s ease;
    transform: translateY(0);
}

.inside-header {
    max-width: 1200px !important;
    padding: 0 !important;
}

.site-content {
    display: flex;  
    flex-direction: column;
}

.main-navigation {
    background-color: transparent !important;
}

/* Scrolled state - white background */
.site-header.scrolled {
    background: #0A0E27 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Hide on scroll down */
.site-header.hide {
    transform: translateY(-100%);
}

/* Navigation text color - white for transparent, black for scrolled */
.site-header:not(.scrolled) .main-navigation a,
.site-header:not(.scrolled) .main-navigation .menu-toggle,
.site-header:not(.scrolled) .site-title a,
.site-header:not(.scrolled) .site-logo a {
    color: #fff;
}

.site-header.scrolled .main-navigation a,
.site-header.scrolled .main-navigation .menu-toggle,
.site-header.scrolled .site-title a,
.site-header.scrolled .site-logo a {
    color: #ffffff !important;
}

/* Mobile menu icon color */
.site-header:not(.scrolled) .menu-toggle svg,
.site-header:not(.scrolled) .menu-toggle .gp-icon {
    fill: #fff;
}

.site-header.scrolled .menu-toggle svg,
.site-header.scrolled .menu-toggle .gp-icon {
    fill: #ffffff;
}

.menu-bar-item {
    display: flex;
}

/* Header phone + CTA on the right of the menu */
@media (min-width: 769px) {
    .main-navigation .menu-bar-items {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .header-cta-wrapper {
        display: inline-flex;
        align-items: center;
        gap: 20px;
    }

    .header-phone-link {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        color: #ffffff;
        font-weight: 500;
        text-decoration: none;
        font-size: 0.98rem;
    }

    .site-header.scrolled .header-phone-link {
        color: #000000;
    }

    .header-phone-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #00D9FF;
        font-size: 1.1rem;
    }

    .header-phone-text {
        white-space: nowrap;
        letter-spacing: 0.02em;
    }

    .header-cta-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 0px 30px !important;
        border-radius: 9px;
        background: #00D9FF;
        color: #000000 !important;
        font-weight: 500;
        font-size: 0.98rem;
        text-decoration: none;
        transition: all 0.2s ease;
        box-shadow: 0 8px 20px rgba(0, 217, 255, 0.4);
        white-space: nowrap;
        line-height: 40px !important;
    }

    .header-cta-button:hover {
        background: #00c4e6;
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(0, 217, 255, 0.45);
    }
}

/* ===== Desktop Submenu Styles ===== */
@media (min-width: 769px) {
    
    /* Submenu container */
    .main-navigation ul ul,
    .main-navigation .main-nav ul ul {
        background: #0A0E27 !important;
        border-radius: 16px;
        padding: 14px 20px;
        min-width: 260px;
        width: auto !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: -10px;
    }
    
    /* Submenu items */
    .main-navigation .main-nav ul ul li {
        margin: 0;
        padding: 0;
    }
    
    /* Submenu links */
    .main-navigation .main-nav ul ul li a,
    .site-header:not(.scrolled) .main-navigation .main-nav ul ul li a,
    .site-header.scrolled .main-navigation .main-nav ul ul li a {
        color: #ffffff !important;
        padding: 12px 16px !important;
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        border-radius: 8px;
        display: flex !important;
        align-items: center;
        gap: 12px;
        transition: all 0.2s ease;
        line-height: 1.4 !important;
    }
    
    /* Submenu link hover */
    .main-navigation .main-nav ul ul li a:hover,
    .site-header:not(.scrolled) .main-navigation .main-nav ul ul li a:hover,
    .site-header.scrolled .main-navigation .main-nav ul ul li a:hover {
        background: rgba(0, 217, 255, 0.1) !important;
        color: #00D9FF !important;
    }
    
    .main-navigation .main-nav ul ul li a:hover::before {
        background: rgba(0, 217, 255, 0.15);
    }
    
    /* Hide dropdown arrow in submenu items */
    .main-navigation .main-nav ul ul .dropdown-menu-toggle {
        display: none !important;
    }
    
    /* Submenu arrow/caret on parent */
    .main-navigation:not(.toggled) ul li:hover > ul,
    .main-navigation:not(.toggled) ul li.sfHover > ul {
        margin-top: -10px;
    }
    
    /* Nested submenus */
    .main-navigation .main-nav ul ul ul {
        margin-top: 0 !important;
        margin-left: 10px;
    }
}

/* ===== Mobile Header Styles ===== */
@media (max-width: 768px) {
    
    /* Mobile header layout */
    .inside-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px !important;
    }
    
    /* Mobile right side - CTA button + hamburger */
    .main-navigation .menu-bar-items {
        display: flex;
        align-items: center;
        gap: 15px;
        order: 2;
    }
    
    /* Mobile CTA button - "Chat with us" style */
    .header-cta-button {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 10px 20px !important;
        border-radius: 8px;
        background: #00D9FF;
        color: #0A0E27 !important;
        font-weight: 500;
        font-size: 0.85rem;
        text-decoration: none;
        white-space: nowrap;
        line-height: 1.4 !important;
    }
    
    /* Hide phone link on mobile */
    .header-phone-link {
        display: none !important;
    }
    
    /* Hamburger menu styling */
    .menu-toggle {
        order: 3;
        padding: 8px !important;
    }
    
    .menu-toggle .gp-icon svg {
        width: 24px;
        height: 24px;
        fill: #ffffff !important;
    }
    
    /* Prevent body scroll when menu is open */
    body.mobile-menu-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    /* ===== Full Screen Mobile Menu ===== */
    .main-navigation.toggled .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #0A0E27;
        padding: 0;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 9999;
    }
    
    /* Mobile menu logo at top */
    .main-navigation.toggled .main-nav::before {
        content: '';
        position: absolute;
        top: 25px;
        left: 35px;
        width: 160px;
        height: 40px;
        background-image: url('/wp-content/themes/generatepress/assets/images/parallel-digital-logo.png');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: left center;
    }
    
    /* Close X button for mobile menu - aligned with logo */
    .mobile-menu-close {
        position: fixed;
        top: 25px;
        right: 35px;
        z-index: 100005;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 30%;
        cursor: pointer;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 0;
        transition: all 0.2s ease;
        pointer-events: auto;
    }

    .menu-toggle {
        margin-top: 10px !important;
    }
    
    /* Show close button when menu is open (button is in body, not nav) */
    body.mobile-menu-open .mobile-menu-close {
        display: flex !important;
        pointer-events: auto !important;
    }
    
    /* Hide close button on desktop */
    @media (min-width: 769px) {
        .mobile-menu-close {
            display: none !important;
        }
    }
    
    .mobile-menu-close::before,
    .mobile-menu-close::after {
        content: '';
        position: absolute;
        width: 24px;
        height: 2px;
        background: #ffffff;
        transition: all 0.2s ease;
    }
    
    .mobile-menu-close::before {
        transform: rotate(45deg);
    }
    
    .mobile-menu-close::after {
        transform: rotate(-45deg);
    }
    
    .mobile-menu-close:hover::before,
    .mobile-menu-close:hover::after {
        background: #00D9FF;
    }
    
    /* Hide close button when submenu panel is open */
    .mobile-submenu-panel.is-open ~ .mobile-menu-close,
    body:has(.mobile-submenu-panel.is-open) .mobile-menu-close {
        display: none !important;
    }
    
    /* Hide default menu toggle when menu is open */
    .main-navigation.toggled .menu-toggle {
        display: none !important;
    }
    
    /* Mobile menu items - Clean simple design */
    .main-navigation.toggled .main-nav > ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 90px 0 120px 0;
        margin: 0;
        list-style: none;
    }
    
    /* Main menu items styling - Matching reference */
    .main-navigation.toggled .main-nav > ul > li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0;
        padding: 0;
    }
    
    .main-navigation.toggled .main-nav > ul > li:first-child {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .main-navigation.toggled .main-nav > ul > li > a {
        display: block;
        padding: 0 40px !important;
        background: transparent;
        color: #ffffff !important;
        font-size: 1.35rem;
        font-weight: 500;
        text-decoration: none;
        transition: color 0.2s ease;
        letter-spacing: -0.01em;
    }
    
    .main-navigation.toggled .main-nav > ul > li > a:hover {
        color: #00D9FF !important;
    }
    
    /* Parent menu item with submenu - show arrow */
    .main-navigation.toggled .main-nav > ul > li.menu-item-has-children > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .main-navigation.toggled .main-nav > ul > li.menu-item-has-children > a::after {
        content: '›';
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        margin-left: 16px;
        font-size: 1.25rem;
        font-weight: 500;
        color: #f8f9ff;
        background: #262d47;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 6px;
    }
    
    /* Hide default dropdown toggle */
    .main-navigation.toggled .dropdown-menu-toggle {
        display: none !important;
    }
    
    /* ===== Hide Original Submenus ===== */
    .main-navigation.toggled .main-nav ul ul,
    .main-navigation.toggled .main-nav .sub-menu {
        display: none !important;
    }
    
    /* ===== Two-Panel Mobile Submenu System - Mobile Only ===== */
    @media (max-width: 768px) {
        .mobile-submenu-panel {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            background: #0A0E27;
            z-index: 100001; /* Higher than main menu */
            transform: translateX(100%);
            transition: transform 0.3s ease;
            overflow-y: auto;
            overflow-x: hidden;
            display: flex;
            flex-direction: column;
        }

        .mobile-submenu-panel.is-open {
            transform: translateX(0);
        }
        
        /* Panel Header - Simple and clear */
        .mobile-panel-header {
            display: flex;
            align-items: center;
            background: rgba(255, 255, 255, 0.1);
            padding: 0;
            flex-shrink: 0;
            border-bottom: 2px solid rgba(0, 217, 255, 0.3);
        }
        
        .mobile-panel-back {
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.1);
            border: none;
            border-right: 1px solid rgba(255, 255, 255, 0.2);
            color: #ffffff;
            font-size: 1.5rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .mobile-panel-back:hover {
            background: rgba(0, 217, 255, 0.3);
            color: #00D9FF;
        }
        
        .mobile-panel-title {
            flex: 1;
            padding: 0 20px;
            color: #ffffff;
            font-size: 1.2rem;
            font-weight: 500;
            text-align: center;
        }

        /* Panel Menu List - Clean */
        .mobile-panel-list {
            list-style: none;
            padding: 20px 0;
            margin: 0;
            flex: 1;
        }
        
        .mobile-panel-list li {
            display: block;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            padding: 0 20px;
        }

        .mobile-panel-list li a {
            display: block;
            padding: 16px 20px;
            color: rgba(255, 255, 255, 0.9);
            font-size: 1.1rem;
            font-weight: 500;
            text-decoration: none;
            background: transparent;
            transition: all 0.2s ease;
        }
        
        .mobile-panel-list li a:hover {
            background: rgba(0, 217, 255, 0.1);
            color: #00D9FF;
            padding-left: 25px;
        }
    }
    
    /* ===== CTA Button at Bottom ===== */
    .mobile-menu-cta {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        padding: 20px !important;
        background: #0A0E27 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        z-index: 100004 !important;
        display: none !important;
        box-sizing: border-box !important;
    }
    
    .main-navigation.toggled ~ .mobile-menu-cta,
    .main-navigation.toggled .mobile-menu-cta {
        display: block !important;
    }
    
    /* Also show when body has menu-open class */
    body.mobile-menu-open .mobile-menu-cta {
        display: block !important;
    }
    
    .mobile-menu-cta a {
        display: block !important;
        width: 100% !important;
        background: #00D9FF !important;
        color: #0A0E27 !important;
        text-align: center !important;
        padding: 16px 30px !important;
        border-radius: 8px !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
        box-sizing: border-box !important;
    }
    
    .mobile-menu-cta a:hover {
        background: #00c4e6 !important;
    }
    
    /* Hide mobile CTA button on desktop */
    @media (min-width: 769px) {
        .mobile-menu-cta {
            display: none !important;
        }
    }
    
    /* Hide overlay - full screen doesn't need it */
    .main-navigation.toggled::before {
        display: none;
    }
}
