/* ============================================================
   CIOFB — Language Switcher Styles
   ============================================================
   Positioned top-right below navbar, inside the hero zone.
   Disappears with a premium exit animation when hero leaves viewport.
   ============================================================ */

.lang-switcher {
  position: fixed;
  top: 82px;
  right: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  /* Entrance */
  animation: langSwitcherSlideIn 0.5s ease 0.6s both;
}

/* Toggle button — pill with globe + label */
.lang-switcher-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1.5px solid rgba(196, 151, 42, 0.45);
  background: rgba(10, 12, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 14px rgba(196, 151, 42, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  color: #C4972A;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.lang-switcher-toggle:hover {
  transform: scale(1.06);
  border-color: rgba(196, 151, 42, 0.8);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.6), 0 0 22px rgba(196, 151, 42, 0.2);
}

.lang-globe {
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

.lang-label {
  line-height: 1;
}

/* Dropdown */
.lang-switcher-dropdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(10, 12, 24, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(196, 151, 42, 0.4);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(196, 151, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.95);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.lang-switcher.open .lang-switcher-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Language option button */
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.lang-option:hover {
  background: rgba(196, 151, 42, 0.15);
  color: #f8fafc;
}

.lang-option.active {
  color: #C4972A;
  background: rgba(196, 151, 42, 0.1);
}

/* Small colored dot indicator */
.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lang-dot-it {
  background: linear-gradient(135deg, #009246, #fff, #CE2B37);
  box-shadow: 0 0 6px rgba(0, 146, 70, 0.4);
}
.lang-dot-en {
  background: linear-gradient(135deg, #012169, #fff, #C8102E);
  box-shadow: 0 0 6px rgba(1, 33, 105, 0.4);
}

/* ==================== ENTRANCE ==================== */
@keyframes langSwitcherSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.8);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ==================== EXIT (when hero scrolls out) ==================== */
@keyframes langSwitcherExit {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
    filter: blur(0);
  }
  60% {
    opacity: 0.6;
    transform: translateY(-8px) scale(0.6) rotate(8deg);
    filter: blur(3px);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) scale(0.2) rotate(16deg);
    filter: blur(10px);
    pointer-events: none;
  }
}

.lang-switcher.exiting {
  animation: langSwitcherExit 0.55s cubic-bezier(0.4, 0, 0.7, 0.2) forwards;
  pointer-events: none;
}

/* Re-entrance when scrolling back up to hero */
@keyframes langSwitcherReenter {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.5) rotate(-8deg);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

.lang-switcher.entering {
  animation: langSwitcherReenter 0.45s cubic-bezier(0, 0, 0.2, 1) forwards;
}

/* Hidden state (after exit animation completes) */
.lang-switcher.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* ==================== MOBILE ==================== */
@media (max-width: 600px) {
  .lang-switcher {
    top: 66px;
    right: 14px;
  }

  .lang-switcher-toggle {
    height: 32px;
    padding: 0 11px;
    font-size: 0.68rem;
    border-radius: 16px;
  }

  .lang-globe {
    width: 13px;
    height: 13px;
  }
}
