/* =========================
   LANGUAGE SWITCHER
========================== */

/* =========================
   LANGUAGE TOGGLE SWITCH (Top Right)
========================== */

.language-toggle {
  display: flex;
  align-items: center;
  margin: 0 8px;
}

.language-toggle-label {
  display: none;
}

/* Toggle Switch Container */
.toggle-switch {
  position: relative;
  width: 70px;
  height: 32px;
  background: rgba(10, 14, 39, 0.8);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

/* Language Labels - показуємо обидві завжди */
.lang-label {
  font-size: 0.7rem;
  font-weight: 800;
  transition: all 0.3s ease;
  pointer-events: none;
  user-select: none;
  color: rgba(224, 224, 224, 0.4);
  z-index: 3;
}

.lang-label-ua {
  order: 1;
}

.lang-label-ru {
  order: 2;
}

/* Toggle Slider - рухається зліва направо */
.toggle-slider {
  position: absolute;
  top: 3px;
  width: 32px;
  height: 26px;
  border-radius: 999px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

/* UA активна - ползунок зліва (блакитний) */
.toggle-switch.active-ua .toggle-slider {
  left: 3px;
  background: linear-gradient(135deg, #00d9ff, #4ee8ff);
  box-shadow: 0 4px 12px rgba(0, 217, 255, 0.5);
}

.toggle-switch.active-ua .lang-label-ua {
  color: #fff;
}

/* RU активна - ползунок справа (золотий) */
.toggle-switch.active-ru .toggle-slider {
  left: 35px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
}

.toggle-switch.active-ru .lang-label-ru {
  color: #0a0e27;
  font-weight: 900;
}

/* Hover Effect */
.toggle-switch:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Click Animation */
.toggle-switch:active .toggle-slider {
  transform: scale(0.95);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .language-toggle {
    margin: 12px auto;
    width: fit-content;
  }

  .toggle-switch {
    width: 60px;
    height: 28px;
  }

  .toggle-slider {
    width: 28px;
    height: 22px;
    top: 3px;
  }

  .toggle-switch.active-ua .toggle-slider {
    left: 2px;
  }

  .toggle-switch.active-ru .toggle-slider {
    left: 30px;
  }

  .lang-label {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .language-toggle {
    margin: 10px auto;
  }

  .toggle-switch {
    width: 56px;
    height: 26px;
  }

  .toggle-slider {
    width: 26px;
    height: 20px;
    top: 3px;
  }

  .toggle-switch.active-ua .toggle-slider {
    left: 2px;
  }

  .toggle-switch.active-ru .toggle-slider {
    left: 28px;
  }
}

/* Language Modal */
.language-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.language-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.language-modal-content {
  position: relative;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f4d 50%, #2a3580 100%);
  border-radius: 28px;
  border: 2px solid rgba(0, 217, 255, 0.35);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 215, 0, 0.1) inset,
    0 0 60px rgba(0, 217, 255, 0.2);
  padding: 40px;
  max-width: 500px;
  width: 100%;
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.language-modal-title {
  margin: 0 0 28px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 950;
  text-align: center;
  background: linear-gradient(135deg, #ffffff 0%, #00d9ff 52%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.language-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  border-radius: 18px;
  background: rgba(26, 31, 77, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  color: var(--text-light);
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.language-option::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.08), transparent);
  transform: translateX(-120%);
  transition: transform 0.65s ease;
  pointer-events: none;
}

.language-option:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 215, 0, 0.45);
  background: rgba(26, 31, 77, 0.75);
  box-shadow: 0 14px 40px rgba(0, 217, 255, 0.16);
}

.language-option:hover::before {
  transform: translateX(120%);
}

.language-option-active {
  border-color: rgba(255, 215, 0, 0.65);
  background: rgba(26, 31, 77, 0.85);
  box-shadow: 0 12px 34px rgba(255, 215, 0, 0.18);
}

.language-option-active::after {
  content: "✓";
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-gold);
  font-size: 1.5rem;
  font-weight: 900;
}

.language-flag {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.language-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-light);
}

.language-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-light);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.language-modal-close:hover {
  background: rgba(255, 120, 120, 0.14);
  border-color: rgba(255, 120, 120, 0.35);
  color: rgba(255, 160, 160, 0.95);
  transform: rotate(90deg);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .language-modal-content {
    padding: 32px 24px;
    margin: 0 16px;
  }

  .language-modal-title {
    font-size: 1.35rem;
    margin-bottom: 22px;
  }

  .language-option {
    padding: 16px 20px;
    gap: 14px;
  }

  .language-flag {
    font-size: 2rem;
  }

  .language-name {
    font-size: 1.1rem;
  }

  .language-option-active::after {
    right: 20px;
    font-size: 1.3rem;
  }

  .language-btn {
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .language-modal-content {
    padding: 28px 20px;
  }

  .language-options {
    gap: 12px;
  }

  .language-option {
    padding: 14px 16px;
  }
}
