/* Header – Figma top nav (node-id 29:107) */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: transparent !important;
    z-index: 10000;
    transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1), background 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.header.scrolled {
    background: rgba(0, 0, 0, 0.8) !important;
}

.header.header-hidden {
    transform: translateY(-100%);
}

/* Navigation - Desktop: Figma x=124, width=1303, height=41 */
.nav-container {
    width: 100%;
    margin: 0 auto;
    padding: 24px 124px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    max-width: 1551px; /* 1303 + 124*2 */
}

/* Left Side */
.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 1001;
}

/* Mobile Menu Button */
.menu-toggle-button {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-height: 44px;
    min-width: 44px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-toggle-button:hover {
    border: none;
}

.menu-toggle-button svg {
    width: 31px;
    height: 15px;
    display: block;
}

.menu-toggle-button svg line {
    stroke: white;
    stroke-width: 1;
}

/* Logo */
.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-img {
    display: block;
    width: auto;
    transition: transform 0.3s;
    width: 160px;
}

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

/* Nav Menu Wrapper - ensure visible on desktop */
.nav-menu-wrapper {
    display: flex;
    align-items: center;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: center;
}

.nav-menu li {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Nav Links - Desktop: All white text, transparent background */
.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    min-height: 44px;
    min-width: 44px;
    text-decoration: none;
    font-family: var(--font-primary);
    font-weight: var(--weight-regular);
    font-size: var(--text-base);
    color: #ffffff !important;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.25s;
    background: transparent !important;
}

.nav-link:hover {
    opacity: 0.85;
    background: transparent !important;
    color: #ffffff !important;
}

.nav-link.active {
    background: transparent !important;
    font-weight: var(--weight-regular);
    color: #ffffff !important;
}

.nav-link.active::after {
    display: none;
}

/* Use Cases Dropdown */
.use-cases-menu {
    position: relative;
}

.use-cases-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    min-height: 44px;
    min-width: 44px;
    background: transparent !important;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: var(--weight-regular);
    font-family: var(--font-primary);
    transition: all 0.25s;
}

.use-cases-button:hover {
    opacity: 0.85;
    background: transparent !important;
    color: #ffffff !important;
}

.use-cases-button svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

.use-cases-button svg {
    transition: transform 0.3s ease;
}

.use-cases-menu.active .use-cases-button svg {
    transform: rotate(180deg);
}

.use-cases-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s;
    z-index: 1001;
}

.use-cases-menu.active .use-cases-dropdown {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.use-cases-dropdown .nav-link {
    width: 100%;
    padding: 10px 16px;
    color: #1a1a1a !important;
}

.use-cases-dropdown .nav-link:hover {
    color: #1a1a1a !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

/* Header Actions - Desktop only */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.login-link,
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-family: var(--font-primary);
    border-radius: var(--radius-md);
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
    transition: all 0.25s;
    white-space: nowrap;
    font-size: var(--text-base);
}

.login-link {
    color: #ffffff !important;
    border: 1px solid transparent;
    font-weight: var(--weight-medium, 500);
    background: transparent !important;
}

.login-link:hover {
    opacity: 0.85;
    background: transparent !important;
    color: #ffffff !important;
}

/* Book A Demo button - White background, black text, rounded corners */
/* Figma: 145×41px */
.cta-button {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #ffffff !important;
    font-weight: var(--weight-medium, 500);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-pill, 50px);
    min-width: 145px;
    height: 41px;
    padding: 10px 20px;
}

.cta-button:hover {
    background: #ffffff !important;
    border-color: #ffffff !important;
    color: #000000 !important;
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Language Switcher */
.language-switcher {
    position: relative;
}

/* Mobile header language switcher - hidden by default, shown on mobile via media.css */
.mobile-header-language-switcher {
    display: none;
}

.desktop-header-language-switcher {
    display: flex;
    align-items: center;
}

.desktop-header-language-switcher .language-switcher-toggle {
    padding: 6px 10px;
    min-height: 36px;
    min-width: auto;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.desktop-header-language-switcher .language-switcher-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.desktop-header-language-switcher .language-switcher-toggle svg {
    color: #fff;
}

.desktop-header-language-switcher .current-lang {
    color: #fff;
}

.language-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    transition: all 0.25s;
    min-height: 44px;
    min-width: 44px;
}

.language-switcher-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.2);
}

.language-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.language-switcher-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.language-switcher.active .language-switcher-toggle svg {
    transform: rotate(180deg);
}

.language-switcher-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 150px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1001;
}

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

.language-switcher-menu li {
    margin: 0;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    min-height: 44px;
}

.lang-option:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #000;
}

.lang-option .language-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
    color: #666;
}

/* Focus Styles */
.nav-link:focus-visible,
.login-link:focus-visible,
.cta-button:focus-visible,
.language-switcher-toggle:focus-visible,
.menu-toggle-button:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Desktop navbar - ensure proper padding, colors, and visible nav links */
@media (min-width: 1024px) {
    .nav-container {
        padding: 24px 124px;
        max-width: 1551px;
    }

    .nav-menu-wrapper,
    .nav-menu {
        display: flex !important;
    }

    .nav-link,
    .use-cases-button,
    .login-link {
        color: #ffffff !important;
    }

    .cta-button {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .mobile-header-language-switcher {
        display: none !important;
    }

    .desktop-header-language-switcher {
        display: flex !important;
    }
}

/* Mobile Menu – Figma node 29-1195 (opened state) */
@media (max-width: 1023px) {
    .nav-container {
        padding: 24px var(--container-padding);
        max-width: 100%;
    }

    /* Mobile menu overlay - Full viewport height */
    .nav-menu.mobile-menu-open {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        padding: 0;
        box-shadow: none;
        align-items: stretch;
        z-index: 99999;
        overflow-y: auto;
        animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        margin: 0;
        padding: 66px;
        backdrop-filter: blur(20px);
    }

    /* Content wrapper to center menu items while navbar is full width */
    .nav-menu.mobile-menu-open::after {
        content: '';
        display: block;
        width: 100%;
        max-width: 390px;
        margin: 0 auto;
    }

    /* Mobile menu header with logo and close button - Full width navbar, centered content */
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px 0;
        border-bottom: none !important;
        background: transparent;
        position: sticky;
        top: 0;
        z-index: 10;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        width: 100%;
        max-width: 390px;
        margin: 0 auto;
    }

    .mobile-menu-header .logo-link {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-menu-header .logo-img {
        height: 28px;
        width: auto;
    }

    .mobile-menu-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        color: #ffffff;
        transition: all 0.2s ease;
    }

    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    .mobile-menu-close svg {
        width: 24px;
        height: 24px;
        stroke: #ffffff;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

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

    /* Mobile menu content wrapper - menu items are direct children - Centered with max-width */
    .nav-menu.mobile-menu-open > li {
        width: 100%;
        max-width: 390px;
        margin: 0 auto;
        list-style: none;
        padding: 0;
        border-bottom: none !important;
        flex-shrink: 0;
    }

    /* Navigation items spacing - Figma: Home y=152, About y=214, Use Cases y=279, Pricing y=468, Contact y=529 */
    .nav-menu.mobile-menu-open > li:not(.mobile-menu-header):not(.mobile-actions) {
        margin-bottom: 0;
    }

    /* Header - no border */
    .nav-menu.mobile-menu-open > .mobile-menu-header {
        border-bottom: none !important;
    }

    /* Actions container - has border-top separator before login section */
    .nav-menu.mobile-menu-open > .mobile-actions {
        border-bottom: none !important;
    }

    /* Mobile menu links - Figma: Home y=152, About y=214, Pricing y=468, Contact y=529 - Full width, no padding */
    .nav-menu.mobile-menu-open .nav-link {
        display: flex !important;
        width: 100%;
        min-height: auto;
        padding: 12px 0;
        text-align: left;
        justify-content: flex-start;
        align-items: center;
        color: #ffffff;
        font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-size: 16px;
        font-weight: 400;
        text-decoration: none;
        transition: all 0.2s ease;
        background: transparent;
        border: none;
    }

    .nav-menu.mobile-menu-open .nav-link:hover,
    .nav-menu.mobile-menu-open .nav-link:focus {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    /* Use Cases menu in mobile */
    .nav-menu.mobile-menu-open .use-cases-menu {
        width: 100%;
        border-bottom: none !important;
    }

    /* Use Cases button - Figma: y=279 - Full width, no padding */
    .nav-menu.mobile-menu-open .use-cases-button {
        width: 100%;
        min-height: auto;
        padding: 12px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: transparent;
        border: none;
        color: #ffffff;
        font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-size: 16px;
        font-weight: 400;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .nav-menu.mobile-menu-open .use-cases-button svg {
        width: 16px;
        height: 16px;
        transition: transform 0.3s ease;
        stroke: #ffffff;
    }

    .nav-menu.mobile-menu-open .use-cases-menu.active .use-cases-button svg {
        transform: rotate(180deg);
    }

    .nav-menu.mobile-menu-open .use-cases-dropdown {
        display: none;
        flex-direction: column;
        background: transparent;
        padding: 0;
        margin: 0;
        border: none;
        box-shadow: none;
    }

    .nav-menu.mobile-menu-open .use-cases-menu.active .use-cases-dropdown {
        display: flex;
        animation: slideDown 0.2s ease;
    }

    /* Use Cases dropdown items - Figma: Architects y=314, Realtors y=353, Interior Designers y=392 - Full width, arrows on left */
    .nav-menu.mobile-menu-open .use-cases-dropdown .nav-link {
        padding: 8px 0;
        font-size: 16px;
        color: #ffffff;
        display: flex !important;
        align-items: center;
        gap: 8px;
        font-weight: 400;
        width: 100%;
        flex-direction: row;
    }

    /* Arrow on the left side of each Use Cases option */
    .nav-menu.mobile-menu-open .use-cases-dropdown .use-case-arrow {
        color: #ffffff !important;
        font-size: 16px;
        font-weight: 400;
        margin-right: 8px;
        margin-left: 0;
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
        width: auto;
        height: auto;
        flex-shrink: 0;
        order: -1; /* Ensure arrow appears first (on the left) */
    }

    /* Mobile actions container - Figma: separator at y=606, Login y=652, Book a Demo y=691 */
    /* Separator line with max-width and centered */
    .mobile-actions {
        display: flex !important;
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
        padding-top: 20px;
        padding-bottom: 20px;
        align-items: stretch;
        width: 100%;
        max-width: 390px;
        margin: 0 auto;
        background: transparent;
        margin-top: auto;
        position: relative;
    }

    .mobile-actions::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        height: 1px;
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-actions .login-create-account {
        text-decoration: none;
        color: #ffffff;
        font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-weight: 400;
        font-size: 16px;
        padding: 8px 0;
        text-align: left;
        width: 100%;
        background: transparent;
        border: none;
        transition: all 0.2s ease;
        line-height: 1.5;
        display: block;
    }

    .mobile-actions .login-create-account:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    /* Book a Demo - Figma: y=691, highlighted text in orange, no button styling, no shadow, no border - Full width, no padding */
    .mobile-actions .cta-button {
        background: transparent !important;
        color: #ff9000 !important;
        border: none !important;
        padding: 8px 0;
        padding-top: 12px;
        border-radius: 0 !important;
        font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-weight: 400 !important;
        font-size: 16px;
        text-decoration: none;
        text-align: left;
        display: block;
        width: 100%;
        transition: all 0.2s ease;
        box-shadow: none !important;
        margin-top: 0;
    }

    .mobile-actions .cta-button:hover {
        background: rgba(255, 255, 255, 0.05) !important;
        transform: none !important;
        box-shadow: none !important;
        color: #ff9000 !important;
    }

    /* Mobile language switcher in menu */
    .mobile-actions .mobile-language-switcher {
        margin-bottom: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        position: relative;
        width: 100%;
    }
}

/* Tablet styles */
@media (max-width: 1023px) {
    .menu-toggle-button {
        display: flex !important;
        background: none;
        border: none;
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
    }

    .menu-toggle-button:hover {
        background: rgba(255, 255, 255, 0.1);
        border: none;
    }

    .menu-toggle-button svg {
        width: 31px;
        height: 15px;
        display: block;
    }

    .menu-toggle-button svg line {
        stroke: white;
        stroke-width: 1;
    }
}

@media (min-width: 1103px) and (max-width: 1200px) {
    .nav-container {
        padding-left: 24px;
        padding-right: 24px;
        max-width: 100%;
    }
}