/**
 * ============================================================================
 * FEWOBILL NAVIGATION COMPONENTS
 * Ergänzung zu arctic-aurora.css
 * ============================================================================
 * 
 * Komponenten:
 * - Main Navigation (fixed, zentriert)
 * - Company Bar (scrollt weg)
 * - Schnellzugriff Mega-Menü
 * - Hamburger → Quadrat Animation
 * ============================================================================
 */

/* ==========================================================================
   MAIN NAVIGATION (Fixed, zentriert)
   ========================================================================== */

.fb-main-nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
}

.fb-nav-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--aa-bg-card);
    padding: 5px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    pointer-events: auto;
}

[data-theme="dark"] .fb-nav-pill {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 1px var(--aa-accent-glow);
}

.fb-nav-item {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--aa-text-muted);
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.2s ease;
    white-space: nowrap;
    outline: none;
}

.fb-nav-item:hover {
    color: var(--aa-violet-700);
    background: var(--aa-violet-50);
    text-decoration: none;
}

.fb-nav-item:focus {
    outline: none;
    box-shadow: none;
}

.fb-nav-item:focus-visible {
    box-shadow: 0 0 0 2px var(--aa-violet-200);
}

.fb-nav-item.active {
    color: var(--aa-violet-700);
    background: var(--aa-violet-100);
}

[data-theme="dark"] .fb-nav-item:hover {
    background: rgba(167, 139, 250, 0.15);
    color: var(--aa-violet-300);
}

[data-theme="dark"] .fb-nav-item.active {
    background: rgba(167, 139, 250, 0.2);
    color: var(--aa-violet-300);
}

/* ==========================================================================
   SCHNELLZUGRIFF BUTTON (Hamburger → Quadrat Animation)
   ========================================================================== */

.fb-schnellzugriff-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--aa-text-primary);
    color: var(--aa-text-inverse);
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.fb-schnellzugriff-btn:hover {
    background: var(--aa-violet-700);
}

.fb-schnellzugriff-btn:focus {
    outline: none;
    box-shadow: none;
}

.fb-schnellzugriff-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--aa-violet-200);
}

[data-theme="dark"] .fb-schnellzugriff-btn {
    background: var(--aa-bg-elevated);
    color: var(--aa-text-primary);
    border: 1px solid var(--aa-border-light);
}

[data-theme="dark"] .fb-schnellzugriff-btn:hover {
    background: var(--aa-primary);
    color: white;
    border-color: var(--aa-primary);
}

/* Hamburger Icon Container */
.fb-hamburger {
    width: 18px;
    height: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fb-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* ========== HAMBURGER → QUADRAT (HOVER) ========== */

/* Basis Hamburger */
.fb-hamburger {
    width: 18px;
    height: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fb-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pseudoelemente initial unsichtbar */
.fb-hamburger::before,
.fb-hamburger::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 0;
    background: currentColor;
    border-radius: 1px;
    top: 0;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fb-hamburger::before {
    left: 0;
}

.fb-hamburger::after {
    right: 0;
}

/* ========== HAMBURGER → QUADRAT ========== */

.fb-hamburger {
    width: 18px;
    height: 18px;
    /* Quadratische Basis für einfachere Kalkulation */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease;
}

.fb-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

/* Vertikale Seitenlinien */
.fb-hamburger::before,
.fb-hamburger::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 0;
    /* Startet bei 0 */
    background: currentColor;
    border-radius: 1px;
    top: 0;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fb-hamburger::before {
    left: 0;
}

.fb-hamburger::after {
    right: 0;
}

/* === HOVER-Zustand === */

/* 1. Die mittlere Linie verschwindet */
.fb-schnellzugriff-btn:hover .fb-hamburger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

/* 2. Obere und untere Linie bilden Deckel und Boden */
/* Wir lassen sie außen, statt sie in die Mitte zu schieben */
.fb-schnellzugriff-btn:hover .fb-hamburger span:nth-child(1),
.fb-schnellzugriff-btn:hover .fb-hamburger span:nth-child(3) {
    transform: translateY(0);
    width: 100%;
}

/* 3. Die vertikalen Linien wachsen auf volle Höhe */
.fb-schnellzugriff-btn:hover .fb-hamburger::before,
.fb-schnellzugriff-btn:hover .fb-hamburger::after {
    height: 100%;
    opacity: 1;
}

/* Optional: Drehung für mehr Dynamik */
.fb-schnellzugriff-btn:hover .fb-hamburger {
    transform: rotate(90deg);
}

/* ==========================================================================
   MEGA MENU (Schnellzugriff Dropdown)
   ========================================================================== */

.fb-mega-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.fb-mega-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

[data-theme="dark"] .fb-mega-menu-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.fb-mega-menu {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--aa-bg-card);
    border-radius: 20px;
    box-shadow: var(--aa-shadow-xl);
    border: 1px solid var(--aa-border-light);
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(3, 200px);
    gap: 32px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.fb-mega-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

[data-theme="dark"] .fb-mega-menu {
    box-shadow: var(--aa-shadow-xl), 0 0 1px var(--aa-accent-glow);
}

.fb-mega-menu-section h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--aa-text-muted);
    margin-bottom: 16px;
    padding: 0 12px;
}

.fb-mega-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--aa-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.fb-mega-menu-item:hover {
    background: var(--aa-violet-50);
    color: var(--aa-violet-700);
    text-decoration: none;
}

[data-theme="dark"] .fb-mega-menu-item:hover {
    background: rgba(167, 139, 250, 0.15);
    color: var(--aa-violet-300);
}

.fb-mega-menu-item svg,
.fb-mega-menu-item [data-lucide] {
    width: 18px;
    height: 18px;
    color: var(--aa-violet-500);
    flex-shrink: 0;
}

/* ==========================================================================
   COMPANY BAR (Oben rechts, scrollt weg)
   ========================================================================== */

.fb-company-bar {
    position: absolute;
    /* fixed statt absolute */
    top: 16px;
    right: 50%;
    transform: translateX(50%);
    /* Zentriert wie main-nav */
    z-index: 100;

    /* NEU - gleiche Logik wie main-nav: */
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    display: flex;
    /* NEU */
    justify-content: flex-end;
    /* NEU - rechtsbündig */
}

.fb-company-trigger {
    pointer-events: auto;

    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    background: var(--aa-bg-card);
    border: 1px solid var(--aa-border-light);
    border-radius: 50px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--aa-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--aa-shadow-sm);
    outline: none;
}

/*
====.fb-company-bar {
    position: absolute;
    top: 16px;
    right: 32px;
    z-index: 100;
}

.fb-company-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    background: var(--aa-bg-card);
    border: 1px solid var(--aa-border-light);
    border-radius: 50px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--aa-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--aa-shadow-sm);
    outline: none;
}

*/

.fb-company-trigger:hover {
    border-color: var(--aa-border-medium);
    box-shadow: var(--aa-shadow-md);
}

.fb-company-trigger:focus {
    outline: none;
    box-shadow: var(--aa-shadow-sm);
}

.fb-company-trigger:focus-visible {
    box-shadow: 0 0 0 2px var(--aa-violet-200);
}

.fb-company-trigger .chevron {
    width: 14px;
    height: 14px;
    color: var(--aa-text-muted);
    transition: transform 0.2s ease;
}

.fb-company-trigger.active .chevron {
    transform: rotate(180deg);
}

/* Avatar mit Initialen */
.fb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--aa-violet-500) 0%, var(--aa-violet-700) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.fb-avatar [data-lucide],
.fb-avatar svg:not(.chevron) {
    width: 16px;
    height: 16px;
}

.fb-user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   COMPANY DROPDOWN MENU
   ========================================================================== */

.fb-company-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--aa-bg-card);
    border-radius: 16px;
    box-shadow: var(--aa-shadow-xl);
    border: 1px solid var(--aa-border-light);
    padding: 8px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
}

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

[data-theme="dark"] .fb-company-menu {
    box-shadow: var(--aa-shadow-xl), 0 0 1px var(--aa-accent-glow);
}

/* Menu Header mit Schnellaktionen */
.fb-menu-header {
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--aa-border-light);
    margin-bottom: 8px;
}

.fb-menu-header-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--aa-text-muted);
    margin-bottom: 10px;
}

.fb-menu-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fb-menu-icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--aa-bg-sunken);
    border: none;
    border-radius: 10px;
    color: var(--aa-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.fb-menu-icon-btn:hover {
    background: var(--aa-violet-50);
    color: var(--aa-violet-600);
}

[data-theme="dark"] .fb-menu-icon-btn:hover {
    background: rgba(167, 139, 250, 0.2);
    color: var(--aa-violet-300);
}

.fb-menu-icon-btn svg,
.fb-menu-icon-btn [data-lucide] {
    width: 18px;
    height: 18px;
}

/* Dark Mode Toggle im Menu */
.fb-theme-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--aa-bg-sunken);
    border-radius: 10px;
    margin: 8px;
}

.fb-theme-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--aa-text-secondary);
}

.fb-theme-label svg,
.fb-theme-label [data-lucide] {
    width: 18px;
    height: 18px;
    color: var(--aa-text-muted);
}

/* Toggle Switch */
.fb-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--aa-border-medium);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.fb-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fb-toggle-switch.active,
[data-theme="dark"] .fb-toggle-switch {
    background: var(--aa-violet-500);
}

.fb-toggle-switch.active::after,
[data-theme="dark"] .fb-toggle-switch::after {
    left: 22px;
}

/* Menu Items */
.fb-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: var(--aa-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.fb-menu-item:hover {
    background: var(--aa-bg-card-hover);
    color: var(--aa-text-primary);
    text-decoration: none;
}

.fb-menu-item svg,
.fb-menu-item [data-lucide] {
    width: 18px;
    height: 18px;
    color: var(--aa-text-muted);
}

.fb-menu-divider {
    height: 1px;
    background: var(--aa-border-light);
    margin: 8px 0;
}

.fb-menu-item.danger {
    color: var(--aa-danger);
}

.fb-menu-item.danger svg,
.fb-menu-item.danger [data-lucide] {
    color: var(--aa-danger);
}

.fb-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* ==========================================================================
   CONTENT SPACER (für fixed Navigation)
   ========================================================================== */

.fb-nav-spacer {
    height: 80px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    .fb-mega-menu {
        grid-template-columns: repeat(2, 180px);
        gap: 24px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .fb-main-nav {
        top: 12px;
        width: calc(100% - 24px);
        left: 12px;
        transform: none;
    }

    .fb-nav-pill {
        width: 100%;
        justify-content: space-between;
        padding: 4px;
    }

    .fb-nav-item {
        padding: 8px 12px;
        font-size: 12px;
    }

    .fb-nav-item span {
        display: none;
    }

    .fb-schnellzugriff-btn {
        padding: 8px 14px;
    }

    .fb-schnellzugriff-btn span {
        display: none;
    }

    .fb-company-bar {
        top: 12px;
        right: 12px;
    }

    .fb-user-name {
        display: none;
    }

    .fb-company-trigger {
        padding: 6px 10px 6px 6px;
    }

    .fb-mega-menu {
        grid-template-columns: 1fr;
        width: calc(100% - 24px);
        left: 12px;
        transform: translateY(-10px);
        max-height: 70vh;
        overflow-y: auto;
    }

    .fb-mega-menu.active {
        transform: translateY(0);
    }
}