/**
 * Wien Navigator - Premium Experience
 * Buttery smooth animations, high-end feel
 */

:root {
  --wien-cyan: #00D4FF;
  --wien-purple: #7B3FF2;
  --wien-bg: #050810;
  --wien-surface: rgba(255, 255, 255, 0.03);
  --wien-border: rgba(255, 255, 255, 0.08);
  --wien-text: rgba(255, 255, 255, 0.9);
  --wien-muted: rgba(255, 255, 255, 0.5);

  /* Premium easing curves */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   MOBILE MENU - WIEN STANDORTE DROPDOWN
   ============================================ */

/* Bezirke grid layout for mobile */
.wien-bezirke-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem !important;
}

.wien-bezirke-grid .mega-service-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem !important;
  font-size: 0.8125rem !important;
}

.bezirk-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 6px;
  color: var(--wien-cyan);
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.wien-bezirke-grid .mega-service-item:hover .bezirk-num,
.wien-bezirke-grid .mega-service-item:active .bezirk-num {
  background: var(--wien-cyan);
  color: #0a0e17;
}

/* Wien category takes full width on mobile */
.mega-category-wien {
  grid-column: 1 / -1;
}

/* Hide Standorte dropdown on desktop - uses modal instead */
@media (min-width: 900px) {
  .nav-dropdown-wien {
    display: none;
  }
}

/* ============================================
   SIDE DOCK TRIGGER BUTTON
   ============================================ */
.side-dock-wien-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0.75rem auto;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition:
    transform 0.4s var(--ease-out-expo),
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.4s var(--ease-out-expo);
}

.side-dock-wien-trigger:hover {
  background: linear-gradient(135deg, var(--wien-cyan), var(--wien-purple));
  border-color: transparent;
  transform: scale(1.12);
  box-shadow:
    0 0 0 4px rgba(0, 212, 255, 0.1),
    0 8px 32px rgba(0, 212, 255, 0.3);
}

.side-dock-wien-trigger:active {
  transform: scale(1.05);
  transition-duration: 0.1s;
}

.wien-mini-map {
  width: 22px;
  height: 22px;
  color: var(--wien-cyan);
  transition: color 0.3s ease, transform 0.4s var(--ease-out-expo);
}

.side-dock-wien-trigger:hover .wien-mini-map {
  color: #fff;
  transform: scale(1.1);
}

/* ============================================
   OVERLAY - Quick Fade
   ============================================ */
.wien-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none; /* Hidden by default to prevent CLS */
  align-items: center;
  justify-content: center;
  background: rgba(3, 5, 10, 0);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition:
    background 0.25s var(--ease-out-quart),
    opacity 0.25s var(--ease-out-quart),
    visibility 0s 0.25s;
}

.wien-nav-overlay.active {
  display: flex; /* Show when active */
  background: rgba(3, 5, 10, 0.92);
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

/* ============================================
   MODAL - Snappy Entrance
   ============================================ */
.wien-nav-modal {
  width: 100%;
  height: 100%;
  background: var(--wien-bg);
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(20px);
  opacity: 0;
  transition:
    transform 0.35s var(--ease-out-expo),
    opacity 0.25s var(--ease-out-quart);
}

.wien-nav-overlay.active .wien-nav-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Exit animation - faster */
.wien-nav-overlay:not(.active) .wien-nav-modal {
  transform: scale(0.98) translateY(12px);
  transition-duration: 0.2s, 0.15s;
}

/* Mobile Header */
.wien-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--wien-border);
  flex-shrink: 0;
}

.wien-nav-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.wien-nav-title svg {
  color: var(--wien-cyan);
  width: 20px;
  height: 20px;
}

/* Close Button - Smooth interaction */
.wien-nav-close {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--wien-border);
  border-radius: 12px;
  color: var(--wien-muted);
  cursor: pointer;
  transition:
    transform 0.4s var(--ease-out-expo),
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

.wien-nav-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: rotate(90deg);
}

.wien-nav-close:active {
  transform: rotate(90deg) scale(0.92);
  transition-duration: 0.1s;
}

.wien-nav-close svg {
  width: 16px;
  height: 16px;
}

/* Visual Panel - Hidden on mobile */
.wien-nav-visual {
  display: none;
}

/* Content */
.wien-nav-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

/* ============================================
   SECTIONS
   ============================================ */
.wien-nav-districts,
.wien-nav-cities,
.wien-nav-industries {
  margin-bottom: 1.75rem;
}

.wien-nav-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--wien-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.wien-nav-section-title svg {
  width: 14px;
  height: 14px;
  color: var(--wien-cyan);
  opacity: 0.6;
}

/* ============================================
   DISTRICTS - Smooth Cards
   ============================================ */
.wien-district-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wien-district-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--wien-surface);
  border: 1px solid var(--wien-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--wien-text);
  font-size: 14px;
  transition:
    transform 0.35s var(--ease-out-expo),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.35s var(--ease-out-expo);
  will-change: transform;
}

.wien-district-link:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.1);
}

.wien-district-link:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

.district-num {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 8px;
  color: var(--wien-cyan);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    transform 0.35s var(--ease-out-expo);
}

.wien-district-link:hover .district-num {
  background: linear-gradient(135deg, var(--wien-cyan), var(--wien-purple));
  color: #fff;
  transform: scale(1.08);
}

.district-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.district-postal {
  font-family: monospace;
  font-size: 11px;
  color: var(--wien-muted);
  transition: color 0.25s ease;
}

.wien-district-link:hover .district-postal {
  color: rgba(0, 212, 255, 0.7);
}

/* ============================================
   CITIES & INDUSTRIES - Floating Pills
   ============================================ */
.wien-city-list,
.wien-industry-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wien-city-link,
.wien-industry-link {
  padding: 10px 16px;
  background: var(--wien-surface);
  border: 1px solid var(--wien-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--wien-text);
  font-size: 14px;
  font-weight: 500;
  transition:
    transform 0.35s var(--ease-out-expo),
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.35s var(--ease-out-expo);
  will-change: transform;
}

.wien-city-link:hover {
  background: var(--wien-purple);
  border-color: transparent;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(123, 63, 242, 0.25);
}

.wien-city-link:active {
  transform: translateY(-1px) scale(0.97);
  transition-duration: 0.1s;
}

.wien-industry-link:hover {
  background: var(--wien-cyan);
  border-color: transparent;
  color: var(--wien-bg);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 212, 255, 0.25);
}

.wien-industry-link:active {
  transform: translateY(-1px) scale(0.97);
  transition-duration: 0.1s;
}

.wien-city-link span,
.wien-industry-link span {
  position: relative;
}

/* ============================================
   DESKTOP - Premium Layout
   ============================================ */
@media (min-width: 900px) {
  .wien-nav-modal {
    display: grid;
    grid-template-columns: 420px 1fr;
    max-width: 95vw;
    width: 1450px;
    height: auto;
    max-height: 92vh;
    margin: 1rem;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.3),
      0 60px 120px rgba(0, 0, 0, 0.7),
      0 0 100px rgba(0, 212, 255, 0.05);
    overflow: hidden;
  }

  .wien-nav-header {
    display: none;
  }

  /* ========================================
     LEFT PANEL - Logo with Premium Glow
     ======================================== */
  .wien-nav-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #020305;
    padding: 3rem;
    overflow: hidden;
    contain: paint;
  }

  /* Subtle ambient gradient - static for performance */
  .wien-nav-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
      ellipse 80% 60% at 50% 120%,
      rgba(0, 212, 255, 0.03) 0%,
      transparent 60%
    );
    pointer-events: none;
  }

  /* Logo Glow Container - completely invisible container */
  .wien-logo-glow-container {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.9);
    animation: logoContainerIn 0.4s var(--ease-out-expo) 0.1s forwards;
  }

  @keyframes logoContainerIn {
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  /* Glow Rings - Silky smooth breathing */
  .wien-glow-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
  }

  .wien-glow-ring-1 {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.18) 0%, transparent 60%);
    animation: breathe1 5s ease-in-out infinite;
  }

  .wien-glow-ring-2 {
    width: 145%;
    height: 145%;
    background: radial-gradient(circle, rgba(123, 63, 242, 0.1) 0%, transparent 55%);
    animation: breathe2 5s ease-in-out infinite;
    animation-delay: -1.5s;
  }

  .wien-glow-ring-3 {
    width: 190%;
    height: 190%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.05) 0%, transparent 50%);
    animation: breathe3 5s ease-in-out infinite;
    animation-delay: -3s;
  }

  @keyframes breathe1 {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.12); opacity: 1; }
  }

  @keyframes breathe2 {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.18); opacity: 0.85; }
  }

  @keyframes breathe3 {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.22); opacity: 0.6; }
  }

  /* Core Glow - no visible edges */
  .wien-logo-core-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(
      circle,
      rgba(0, 212, 255, 0.25) 0%,
      rgba(123, 63, 242, 0.15) 30%,
      transparent 55%
    );
    filter: blur(50px);
    animation: coreGlow 5s ease-in-out infinite;
    will-change: transform, opacity;
    transition: opacity 0.4s ease, transform 0.5s var(--ease-out-expo);
    pointer-events: none;
  }

  @keyframes coreGlow {
    0%, 100% {
      transform: scale(1);
      opacity: 0.7;
    }
    50% {
      transform: scale(1.2);
      opacity: 1;
    }
  }

  /* Logo Image - clean edges */
  .wien-nav-logo {
    position: relative;
    width: 220px;
    height: auto;
    z-index: 2;
    opacity: 0;
    transform: scale(0.92);
    animation: logoIn 0.35s var(--ease-out-expo) 0.15s forwards;
    filter: drop-shadow(0 0 40px rgba(0, 212, 255, 0.2));
    transition: filter 0.4s ease, transform 0.4s var(--ease-out-expo);
    /* Ensure no visible edges */
    background: none;
    border: none;
    outline: none;
  }

  @keyframes logoIn {
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  /* Logo hover - subtle glow intensify */
  .wien-logo-glow-container:hover .wien-nav-logo {
    filter: drop-shadow(0 0 60px rgba(0, 212, 255, 0.35));
    transform: scale(1.03);
  }

  .wien-logo-glow-container:hover .wien-logo-core-glow {
    opacity: 1;
    transform: scale(1.15);
  }

  .wien-tagline {
    margin: 2rem 0 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--wien-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(10px);
    animation: taglineIn 0.3s var(--ease-out-quart) 0.25s forwards;
    position: relative;
    z-index: 2;
  }

  @keyframes taglineIn {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* ========================================
     RIGHT PANEL - Content with Stagger
     ======================================== */
  .wien-nav-content {
    position: relative;
    padding: 2.25rem;
    background: linear-gradient(180deg, #080c15 0%, #050810 100%);
    overflow-y: auto;
    overflow-x: hidden;
    contain: paint;
  }

  /* Premium divider line */
  .wien-nav-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2rem;
    bottom: 2rem;
    width: 1px;
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(0, 212, 255, 0.15) 20%,
      rgba(0, 212, 255, 0.25) 50%,
      rgba(0, 212, 255, 0.15) 80%,
      transparent 100%
    );
  }

  .wien-nav-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10;
    opacity: 0;
    transform: scale(0.9);
    animation: closeIn 0.25s var(--ease-out-expo) 0.2s forwards;
  }

  @keyframes closeIn {
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  /* Quick Section Entrance */
  .wien-nav-districts {
    opacity: 0;
    transform: translateY(15px);
    animation: sectionIn 0.3s var(--ease-out-expo) 0.1s forwards;
  }

  .wien-nav-cities {
    opacity: 0;
    transform: translateY(15px);
    animation: sectionIn 0.3s var(--ease-out-expo) 0.15s forwards;
  }

  .wien-nav-industries {
    opacity: 0;
    transform: translateY(15px);
    animation: sectionIn 0.3s var(--ease-out-expo) 0.2s forwards;
  }

  @keyframes sectionIn {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .wien-nav-section-title {
    font-size: 11px;
    margin-bottom: 1.25rem;
  }

  /* Districts Grid */
  .wien-nav-districts {
    margin-bottom: 2.25rem;
  }

  .wien-district-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .wien-district-link {
    padding: 14px 16px;
    gap: 12px;
    border-radius: 14px;
    font-size: 13px;
  }

  .district-num {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
    border-radius: 10px;
  }

  .district-name {
    font-size: 13px;
  }

  .district-postal {
    display: none;
  }

  /* Cities & Industries */
  .wien-nav-cities,
  .wien-nav-industries {
    margin-bottom: 2.25rem;
  }

  .wien-city-link,
  .wien-industry-link {
    padding: 11px 20px;
    font-size: 13px;
    border-radius: 10px;
  }

  /* Premium Scrollbar */
  .wien-nav-content::-webkit-scrollbar {
    width: 6px;
  }

  .wien-nav-content::-webkit-scrollbar-track {
    background: transparent;
  }

  .wien-nav-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--wien-cyan), var(--wien-purple));
    border-radius: 3px;
    opacity: 0.3;
  }

  .wien-nav-content::-webkit-scrollbar-thumb:hover {
    opacity: 0.5;
  }
}

/* ============================================
   LARGE DESKTOP
   ============================================ */
@media (min-width: 1400px) {
  .wien-nav-modal {
    grid-template-columns: 480px 1fr;
    width: 1550px;
  }

  .wien-logo-glow-container {
    width: 380px;
    height: 380px;
  }

  .wien-nav-logo {
    width: 260px;
  }

  .wien-logo-core-glow {
    width: 350px;
    height: 350px;
  }

  .wien-nav-content {
    padding: 2.75rem;
  }

  .wien-district-list {
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
  }

  .wien-district-link {
    padding: 16px 18px;
    font-size: 14px;
  }

  .district-num {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .district-name {
    font-size: 14px;
  }

  .wien-city-link,
  .wien-industry-link {
    padding: 12px 22px;
    font-size: 14px;
  }
}

/* ============================================
   EXIT ANIMATIONS - Quick Close
   ============================================ */
.wien-nav-overlay:not(.active) .wien-logo-glow-container {
  animation: none;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.15s ease, transform 0.18s var(--ease-out-quart);
}

.wien-nav-overlay:not(.active) .wien-nav-logo {
  animation: none;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.12s ease, transform 0.15s var(--ease-out-quart);
}

.wien-nav-overlay:not(.active) .wien-tagline {
  animation: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.wien-nav-overlay:not(.active) .wien-nav-close {
  animation: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.wien-nav-overlay:not(.active) .wien-nav-districts,
.wien-nav-overlay:not(.active) .wien-nav-cities,
.wien-nav-overlay:not(.active) .wien-nav-industries {
  animation: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.12s ease, transform 0.15s var(--ease-out-quart);
}

/* ============================================
   REDUCED MOTION - Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }

  .wien-nav-modal {
    transform: none !important;
    filter: none !important;
  }

  .wien-logo-glow-container,
  .wien-nav-logo,
  .wien-tagline,
  .wien-nav-close,
  .wien-nav-districts,
  .wien-nav-cities,
  .wien-nav-industries {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================
   UTILITIES
   ============================================ */
body.wien-nav-open {
  overflow: hidden;
}

@media print {
  .wien-nav-overlay,
  .side-dock-wien-trigger {
    display: none !important;
  }
}
