/**
 * WBIO Header V3 - Architecture: Modern, Clean, Robust
 * Namespace: .wb-hdr
 */

:root {
    --wb-hdr-height-desktop: 100px;
    --wb-hdr-height-stuck: 80px;
    --wb-hdr-height-mobile: 80px;
    --wb-hdr-bg: #ffffff;
    --wb-hdr-text: #1d1d1f;
    --wb-hdr-primary: #025add;
    --wb-hdr-accent: #4ade80;
    --wb-hdr-transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Master Shell */
.wb-hdr {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important; /* Extremely high z-index to avoid overlap */
    background: var(--wb-hdr-bg);
    height: var(--wb-hdr-height-desktop);
    display: block !important; /* Back to block for predictable auto-margin centering */
    transition: var(--wb-hdr-transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Ensure no default lists interfere */
.wb-hdr ul, 
.wb-hdr li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Scrolled / Stuck State */
.wb-hdr--stuck {
    height: var(--wb-hdr-height-stuck) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.12) !important;
}

/* Home / Transparent State */
.wb-hdr--transparent:not(.wb-hdr--stuck) {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.wb-hdr--transparent:not(.wb-hdr--stuck) .wb-hdr__inner {
    border-bottom: none !important;
}

.wb-hdr--transparent:not(.wb-hdr--stuck) .wb-hdr__link {
    color: #ffffff !important;
}

.wb-hdr--transparent:not(.wb-hdr--stuck) .wb-hdr__link i {
    color: rgba(255, 255, 255, 0.7) !important;
}

.wb-hdr--transparent:not(.wb-hdr--stuck) .wb-hdr__link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Logo filtering for transparent state (if dark logo is used) */
.wb-hdr--transparent:not(.wb-hdr--stuck) .wb-hdr__logo-img {
    filter: none !important; /* Terug naar origineel logo */
}

.wb-hdr__inner {
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

@media (min-width: 1200px) {
    .wb-hdr__inner { max-width: 1140px !important; }
}
@media (min-width: 1400px) {
    .wb-hdr__inner { max-width: 1320px !important; }
}

/* Logo */
.wb-hdr__logo {
    display: flex !important;
    align-items: center !important;
    z-index: 3101 !important;
    flex: 1 1 20% !important; /* Allow some flexible growth but keep balanced */
    justify-content: flex-start !important;
}

.wb-hdr__logo-img {
    height: 60px !important;
    width: auto !important;
    transition: var(--wb-hdr-transition);
}

.wb-hdr--stuck .wb-hdr__logo-img {
    height: 48px !important;
}

/* Desktop Navigation */
.wb-hdr__nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 60% !important; /* The center piece takes more space */
}

.wb-hdr__menu {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 32px !important; /* Nog meer ruimte tussen menu items voor rustiger beeld */
    height: 100% !important;
}

/* CTA Wrapper on Desktop */
.wb-hdr__desktop-cta {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex: 1 1 20% !important; /* Match logo flex for perfect visual center */
}

@media (max-width: 991px) {
    .wb-hdr__desktop-cta {
        display: none !important;
    }
}

.wb-hdr__item {
    position: relative !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}

.wb-hdr__link {
    color: var(--wb-hdr-text) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    transition: var(--wb-hdr-transition);
    padding: 12px 22px !important; /* Nog iets luxere/bredere padding */
    border-radius: 100px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

.wb-hdr__link:hover,
.wb-hdr__item:hover > .wb-hdr__link {
    color: var(--wb-hdr-primary) !important;
    background: rgba(2, 90, 221, 0.05) !important;
}

/* Dropdown Support Desktop */
.wb-hdr__dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(10px) !important;
    background: #ffffff !important;
    min-width: 240px !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12) !important;
    padding: 12px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: block !important; /* Keep as block for transitions, but hidden by opacity */
    transition: var(--wb-hdr-transition);
    list-style: none !important;
    margin: 0 !important;
    z-index: 3000 !important;
}

/* When opacity/visibility fails, force hide/show with display */
@media (min-width: 992px) {
    .wb-hdr__dropdown {
        display: none !important;
    }
    .wb-hdr__item:hover .wb-hdr__dropdown {
        display: block !important;
    }
}

.wb-hdr__dropdown--right {
    left: auto !important;
    right: 0 !important;
    transform: translateY(10px) !important;
}

.wb-hdr__item:hover .wb-hdr__dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
}

.wb-hdr__item:hover .wb-hdr__dropdown--right {
    transform: translateY(0) !important;
}

.wb-hdr__link i {
    transition: transform 0.3s ease !important;
}

.wb-hdr__item:hover .wb-hdr__link i,
.wb-hdr__item:hover .wb-hdr__cta i:last-child {
    transform: rotate(180deg) !important;
}

.wb-hdr__dropdown-link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    color: var(--wb-hdr-text) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
}

.wb-hdr__dropdown-link:hover {
    background: rgba(2, 90, 221, 0.06) !important;
    color: var(--wb-hdr-primary) !important;
}

.wb-hdr__dropdown-link i {
    font-size: 1.1em !important;
    opacity: 0.8 !important;
}

/* Transparent State Colors */
.wb-hdr--transparent:not(.wb-hdr--stuck) .wb-hdr__link {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.wb-hdr--transparent:not(.wb-hdr--stuck) .wb-hdr__link:hover,
.wb-hdr--transparent:not(.wb-hdr--stuck) .wb-hdr__item:hover > .wb-hdr__link {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

.wb-hdr--transparent:not(.wb-hdr--stuck) .wb-hdr__dropdown {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* CTA Button */
.wb-hdr__cta {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 12px 28px !important;
    background: linear-gradient(135deg, var(--wb-hdr-primary) 0%, #0c6de0 100%) !important;
    color: #ffffff !important;
    border-radius: 50px !important;
    font-weight: 800 !important;
    font-size: 15px !important;
    text-decoration: none !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    box-shadow: 0 10px 25px rgba(2, 90, 221, 0.3) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

.wb-hdr__cta-pulse {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(255, 255, 255, 0.45) !important;
    border-radius: 50px !important;
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    animation: wbHdrCtaPulse 2.5s infinite !important;
}

@keyframes wbHdrCtaPulse {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0; }
    50% { opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

.wb-hdr__cta:hover {
    transform: translateY(-3px) scale(1.03) !important;
    box-shadow: 0 15px 35px rgba(2, 90, 221, 0.4) !important;
    background: linear-gradient(135deg, #0c6de0 0%, var(--wb-hdr-primary) 100%) !important;
}

.wb-hdr__cta:active {
    transform: translateY(-1px) scale(0.98) !important;
}

/* Shiny sweep effect on hover */
.wb-hdr__cta::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 50% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent) !important;
    transform: skewX(-25deg) !important;
    transition: 0.75s !important;
}

.wb-hdr__cta:hover::after {
    left: 150% !important;
}

/* Mobile Toggle */
.wb-hdr__toggle {
    display: none !important;
    width: 44px !important;
    height: 44px !important;
    border: none !important;
}

/* MOBILE RESPONSIVE OVERRIDES */
@media (min-width: 992px) {
    .wb-hdr__mobile-menu {
        display: none !important;
    }
}

/* MOBILE RESPONSIVE */
@media (max-width: 991px) {
    .wb-hdr {
        height: 75px !important; /* Terug naar compactere hoogte */
    }
    .wb-hdr__inner {
        height: 75px !important;
        padding: 0 20px !important;
    }
    .wb-hdr__logo-img {
        height: 50px !important; /* Logo formaat voor alle telefoons */
        width: auto !important;
        object-fit: contain !important;
    }
    .wb-hdr__nav {
        display: none !important;
    }
    .wb-hdr__toggle {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        align-items: center !important;
        justify-content: center !important;
        width: 50px !important; /* Match met logo hoogte */
        height: 50px !important;
        background: rgba(2, 90, 221, 0.08) !important;
        color: var(--wb-hdr-primary) !important;
        border-radius: 12px !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 3101 !important;
        transition: var(--wb-hdr-transition);
    }
    
    .wb-hdr__toggle-bar {
        display: block !important;
        width: 26px !important;
        height: 2.5px !important;
        background: currentColor !important;
        border-radius: 5px !important;
        transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6) !important;
        transform-origin: center !important;
    }

    /* Hamburger Animation to X */
    body.wb-hdr-open .wb-hdr__toggle-bar:nth-child(1) {
        transform: translateY(8.5px) rotate(45deg) !important;
    }
    body.wb-hdr-open .wb-hdr__toggle-bar:nth-child(2) {
        opacity: 0 !important;
        transform: translateX(-20px) !important;
    }
    body.wb-hdr-open .wb-hdr__toggle-bar:nth-child(3) {
        transform: translateY(-8.5px) rotate(-45deg) !important;
    }
    
    /* Als het menu NIET open is en we zijn in transparante modus */
    body:not(.wb-hdr-open) .wb-hdr--transparent:not(.wb-hdr--stuck) .wb-hdr__toggle {
        background: rgba(255, 255, 255, 0.15) !important;
        color: #ffffff !important;
    }

    /* Forceer zichtbaarheid van toggle en logo als menu open is */
    body.wb-hdr-open .wb-hdr__toggle {
        background: rgba(2, 90, 221, 0.1) !important;
        color: var(--wb-hdr-primary) !important;
        z-index: 3200 !important;
    }

    .wb-hdr__mobile-menu {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100dvh !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(25px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
        z-index: 3100 !important;
        display: none !important;
        flex-direction: column !important;
        padding: 100px 30px 40px !important;
        transition: var(--wb-hdr-transition);
        transform: translateY(-20px) !important;
        opacity: 0 !important;
    }

    body.wb-hdr-open .wb-hdr__mobile-menu {
        display: flex !important;
        transform: translateY(0) !important;
        opacity: 1 !important;
    }

    /* Fix header appearance when menu is open at the top */
    body.wb-hdr-open .wb-hdr {
        background: #ffffff !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    }

    body.wb-hdr-open .wb-hdr__logo-img {
        filter: none !important; /* Altijd het gekleurde logo tonen als menu open is */
    }

    .wb-hdr__mobile-list {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .wb-hdr__mobile-item {
        opacity: 0 !important;
        transform: translateX(-30px) !important;
        transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    body.wb-hdr-open .wb-hdr__mobile-item {
        opacity: 1 !important;
        transform: translateX(0) !important;
    }

    /* Staggered Delay for menu items */
    body.wb-hdr-open .wb-hdr__mobile-item:nth-child(1) { transition-delay: 0.05s !important; }
    body.wb-hdr-open .wb-hdr__mobile-item:nth-child(2) { transition-delay: 0.1s !important; }
    body.wb-hdr-open .wb-hdr__mobile-item:nth-child(3) { transition-delay: 0.15s !important; }
    body.wb-hdr-open .wb-hdr__mobile-item:nth-child(4) { transition-delay: 0.2s !important; }
    body.wb-hdr-open .wb-hdr__mobile-item:nth-child(5) { transition-delay: 0.25s !important; }
    body.wb-hdr-open .wb-hdr__mobile-item:nth-child(6) { transition-delay: 0.3s !important; }
    body.wb-hdr-open .wb-hdr__mobile-item:nth-child(7) { transition-delay: 0.35s !important; }
    body.wb-hdr-open .wb-hdr__mobile-item:nth-child(8) { transition-delay: 0.4s !important; }

    .wb-hdr__mobile-link {
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #111827 !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        padding: 16px 0 !important;
        border-bottom: 1px solid rgba(0,0,0,0.06) !important;
        transition: all 0.2s ease !important;
    }

    .wb-hdr__mobile-link i {
        font-size: 1.2em !important;
        width: 30px !important;
        display: flex !important;
        justify-content: center !important;
        margin-right: 15px !important;
        color: #111827 !important;
    }

    body.wb-hdr-open .wb-hdr__toggle {
        background: rgba(2, 90, 221, 0.1) !important;
        color: var(--wb-hdr-primary) !important;
        z-index: 3200 !important;
    }
}

@media (max-width: 575px) {
    .wb-hdr__inner { padding: 0 15px !important; }
    .wb-hdr__logo-img { height: 50px !important; } /* Gelijkgetrokken voor alle telefoons */
    .wb-hdr__mobile-link { font-size: 20px !important; }
}

/* NUKE OLD THEME ELEMENTS ON PC */
@media (min-width: 992px) {
    .mobile-nav-toggle,
    .mobile-nav-show,
    .mobile-nav-hide,
    #navbar-mobile-toggle,
    .navbar-toggler,
    .navbar-logo-mobile,
    #header .contact-info,
    #header .social-links {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}
