/* Header Component Styles */
.navbar {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 1.5rem);
    max-width: 1280px;
    z-index: 9999;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
    padding: 0.5rem 0;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.navbar.header-hidden {
    transform: translateX(-50%) translateY(-120%);
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #f97316, #ea580c);
    width: 0%;
    z-index: 10000;
    transition: width 0.1s ease;
}

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

/* Brand/Logo */
.nav-brand a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    transition: color 0.3s ease;
    white-space: nowrap;
}

.navbar.scrolled .brand-text {
    color: #f97316;
    text-shadow: none;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    border-radius: 0.375rem;
    position: relative;
    white-space: nowrap;
}

.navbar.scrolled .nav-link {
    color: #1A1A1A;
}

.nav-link:hover,
.nav-link.active {
    color: #f97316;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar.scrolled .nav-link:hover,
.navbar.scrolled .nav-link.active {
    color: #f97316;
    background-color: #F9FAFB;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-icon {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.15);
    border-radius: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    list-style: none;
    padding: 8px 0;
    margin: 0;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #1A1A1A;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 400;
}

.dropdown-menu a:hover {
    padding-left: 24px;
    background-color: #F9FAFB;
    color: #f97316;
}

/* CTA Button */
.btn-nav-cta {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    padding: 0.35rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

/* CTA Wrapper - separate flex item for centered nav layout */
.nav-cta-wrapper {
    flex-shrink: 0;
}

/* Domain Switcher */
.domain-switcher {
    margin-left: 20px;
}

.domain-switch-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: all 0.3s ease;
}

.domain-switch-link:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.domain-flag {
    width: 20px;
    height: 20px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.domain-flag.de {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1IDMiPjxwYXRoIGQ9Ik0wIDBoNXYxSDB6Ii8+PHBhdGggZmlsbD0iI0QwMCIgZD0iTTAgMWg1djFIMHoiLz48cGF0aCBmaWxsPSIjRkZDRTAwIiBkPSJNMCAyaDV2MUgweiIvPjwvc3ZnPg==');
}

.domain-flag.ch {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iI0Q1MkIxRSIgZD0iTTAgMGgzMnYzMkgweiIvPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xMyA2aDZ2N2g3djZoLTd2N2gtNnYtN0g2di02aDd6Ii8+PC9zdmc+');
}

.domain-text {
    font-size: 14px;
    font-weight: 500;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

/* Hide nav menu on mobile, show toggle */
@media (max-width: 1023px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Hide desktop CTA wrapper on mobile */
    .nav-cta-wrapper {
        display: none;
    }
}

/* Show nav menu on desktop */
@media (min-width: 1024px) {
    .nav-menu {
        display: flex !important;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        padding: 0;
        max-height: none;
        overflow: visible;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    /* Hide mobile-only CTA on desktop */
    .nav-item.mobile-only {
        display: none !important;
    }
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.navbar.scrolled .hamburger-line {
    background-color: #1A1A1A;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Tablet Responsive (641px - 1023px) */
@media (min-width: 641px) and (max-width: 1023px) {
    .navbar {
        width: 100%;
        top: 0;
        left: 0;
        transform: translateX(0);
        border-radius: 0;
        padding: 0.75rem 0;
    }

    .navbar.header-hidden {
        transform: translateX(0) translateY(-120%);
    }

    .nav-menu {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        top: 70px;
        flex-direction: column;
        background-color: #111827;
        width: 100%;
        margin: 0;
        transition: all 0.3s ease;
        box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
        padding: 1.5rem;
        align-items: stretch;
        gap: 0;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        border-radius: 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-item {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        padding: 1rem;
        color: #ffffff !important;
        font-weight: 500;
        font-size: 1.125rem;
        border-radius: 0;
    }

    .nav-link:hover {
        color: #f97316 !important;
        background-color: rgba(249, 115, 22, 0.1) !important;
        padding-left: 1.5rem !important;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: transparent;
        display: none;
        padding-left: 1rem;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        color: rgba(255, 255, 255, 0.9) !important;
        padding: 0.75rem 1rem !important;
    }

    .nav-cta {
        margin-top: 1.5rem;
    }

    .btn-nav-cta {
        display: block;
        text-align: center;
        background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
        color: #ffffff !important;
        padding: 0.875rem 1.5rem !important;
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .navbar {
        width: 100%;
        top: 0;
        left: 0;
        transform: translateX(0);
        border-radius: 0;
        padding: 1.125rem 0;
    }

    .navbar.header-hidden {
        transform: translateX(0) translateY(-120%);
    }

    .nav-container {
        padding: 0 1rem;
    }

    .brand-text {
        font-size: 1.1rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        top: 60px;
        flex-direction: column;
        background-color: #111827;
        width: 100%;
        margin: 0;
        transition: all 0.3s ease;
        box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
        padding: 1.5rem;
        align-items: stretch;
        gap: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        border-radius: 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-item {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        padding: 1rem;
        margin: 0 -1rem;
        color: #ffffff !important;
        font-weight: 500;
        font-size: 1.125rem;
        border-radius: 0;
        transition: all 0.3s ease;
    }

    .nav-link:hover {
        color: #f97316 !important;
        background-color: rgba(249, 115, 22, 0.1) !important;
        padding-left: 1.5rem !important;
    }

    .nav-link.active {
        color: #f97316 !important;
        background-color: rgba(249, 115, 22, 0.1) !important;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: transparent;
        margin-top: 0.5rem;
        display: none;
        border-radius: 0;
        padding: 0;
        padding-left: 1rem;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        color: rgba(255, 255, 255, 0.9) !important;
        padding: 0.75rem 1rem !important;
        font-weight: 400 !important;
        font-size: 1rem;
    }

    .dropdown-menu a:hover {
        color: #f97316 !important;
        background-color: rgba(249, 115, 22, 0.1) !important;
        padding-left: 1.5rem !important;
    }

    .dropdown-icon {
        float: right;
        color: rgba(255, 255, 255, 0.5);
    }

    /* Hide CTA on mobile like MRCH */
    .nav-cta {
        margin-top: 1.5rem;
    }

    .btn-nav-cta {
        display: block;
        text-align: center;
        background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
        color: #ffffff !important;
        font-weight: 600 !important;
        padding: 0.875rem 1.5rem !important;
        border-radius: 0.5rem !important;
    }

    .btn-nav-cta:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
    }
}

/* Accessibility */
.nav-link:focus,
.btn-nav-cta:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Homepage specific navbar styles */
.homepage .navbar:not(.scrolled) {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.homepage .navbar:not(.scrolled) .nav-container {
    background: transparent;
    border-radius: 0;
}

/* When scrolled on homepage */
.homepage .navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Non-homepage pages - white header by default */
body:not(.homepage) .navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body:not(.homepage) .navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Non-homepage brand and nav links - dark color */
body:not(.homepage) .brand-text {
    color: #f97316;
    text-shadow: none;
}

body:not(.homepage) .nav-link {
    color: #1A1A1A !important;
}

body:not(.homepage) .nav-link:hover {
    color: #f97316 !important;
}

body:not(.homepage) .hamburger-line {
    background-color: #1A1A1A !important;
}

body:not(.homepage) .dropdown-icon {
    color: #64748b;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #f97316;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}