/* =========================================================
   SPCX TOKEN — I18N STYLES
   Language switcher button + dropdown + auto-detect banner
   Matches site theme: dark navy + electric blue
   ========================================================= */

/* ===== LANGUAGE SWITCHER WRAPPER ===== */
.SPCX-lang-switcher {
  position: relative;
  display: inline-block;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  z-index: 500;
}

/* ===== BUTTON ===== */
.SPCX-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  height: 40px;
  min-width: 0;
}

.SPCX-lang-btn:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(59, 130, 246, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}

.SPCX-lang-btn:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

.SPCX-lang-btn svg {
  flex-shrink: 0;
  color: #60a5fa;
  width: 15px;
  height: 15px;
}

.SPCX-lang-btn .SPCX-lang-chevron {
  width: 11px;
  height: 11px;
  color: #64748b;
  transition: transform 0.25s ease;
  margin-left: 1px;
}

.SPCX-lang-open .SPCX-lang-btn {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.SPCX-lang-open .SPCX-lang-btn .SPCX-lang-chevron {
  transform: rotate(180deg);
}

.SPCX-lang-btn-label {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== DROPDOWN MENU ===== */
.SPCX-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(59, 130, 246, 0.05);
  padding: 6px;
  z-index: 501;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  max-height: 400px;
  overflow-y: auto;
}

.SPCX-lang-open .SPCX-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Menu scrollbar */
.SPCX-lang-menu::-webkit-scrollbar {
  width: 5px;
}

.SPCX-lang-menu::-webkit-scrollbar-track {
  background: transparent;
}

.SPCX-lang-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.SPCX-lang-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== MENU ITEMS ===== */
.SPCX-lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px;
}

.SPCX-lang-item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #ffffff;
}

.SPCX-lang-item:active {
  transform: scale(0.98);
  transition-duration: 0.08s;
}

.SPCX-lang-item-active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  position: relative;
}

.SPCX-lang-item-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: #3b82f6;
  border-radius: 0 3px 3px 0;
}

.SPCX-lang-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.SPCX-lang-item-code {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.SPCX-lang-item-active .SPCX-lang-item-code {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
}

/* ===== AUTO-DETECT BANNER ===== */
.SPCX-lang-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 40px rgba(59, 130, 246, 0.15);
  padding: 0;
  z-index: 9998;
  max-width: 92vw;
  width: max-content;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.SPCX-lang-banner-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.SPCX-lang-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #e2e8f0;
  font-size: 13.5px;
  font-weight: 500;
}

.SPCX-lang-banner-content > svg {
  color: #60a5fa;
  flex-shrink: 0;
}

.SPCX-lang-banner-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.SPCX-lang-banner-text strong {
  color: #60a5fa;
  font-weight: 700;
}

.SPCX-lang-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.SPCX-lang-banner-yes,
.SPCX-lang-banner-no {
  padding: 7px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  border: 1px solid transparent;
}

.SPCX-lang-banner-yes {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.SPCX-lang-banner-yes:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.SPCX-lang-banner-yes:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.08s;
}

.SPCX-lang-banner-no {
  background: transparent;
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.12);
}

.SPCX-lang-banner-no:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.2);
}

.SPCX-lang-banner-no:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

/* ===== RESPONSIVE — MOBILE ===== */

@media (max-width: 1024px) {
  .SPCX-lang-btn {
    padding: 7px 10px;
    font-size: 12.5px;
    height: 38px;
  }
  .SPCX-lang-btn-label {
    max-width: 70px;
  }
}

@media (max-width: 768px) {
  /* On mobile, hide the language name from the button — show only 🌐 + code */
  .SPCX-lang-btn-label {
    max-width: 40px;
    font-size: 11.5px;
  }
  .SPCX-lang-btn {
    padding: 7px 9px;
    gap: 5px;
    height: 36px;
  }
  .SPCX-lang-btn svg:first-child {
    width: 14px;
    height: 14px;
  }

  .SPCX-lang-menu {
    min-width: 180px;
    right: 0;
  }

  .SPCX-lang-item {
    padding: 9px 10px;
    font-size: 13px;
    min-height: 42px;
  }

  /* Banner stacks on mobile */
  .SPCX-lang-banner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    transform: translateY(20px);
    width: auto;
    max-width: none;
  }

  .SPCX-lang-banner-visible {
    transform: translateY(0);
  }

  .SPCX-lang-banner-content {
    padding: 11px 13px;
    gap: 10px;
    font-size: 12.5px;
    flex-wrap: wrap;
  }

  .SPCX-lang-banner-text {
    white-space: normal;
    flex-basis: calc(100% - 30px);
  }

  .SPCX-lang-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .SPCX-lang-banner-yes,
  .SPCX-lang-banner-no {
    padding: 7px 12px;
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .SPCX-lang-btn {
    padding: 6px 8px;
    height: 34px;
  }
  .SPCX-lang-btn-label {
    display: none;
  }
  .SPCX-lang-btn .SPCX-lang-chevron {
    display: none;
  }
  .SPCX-lang-btn svg:first-child {
    width: 16px;
    height: 16px;
  }

  .SPCX-lang-menu {
    min-width: 170px;
  }
}

/* ===== MOBILE MENU INTEGRATION ===== */
/* On mobile, hide switcher from header (it will appear inside mobile menu via JS) */
@media (max-width: 1024px) {
  .Header-module__lnUIdW__headerActions .SPCX-lang-switcher {
    display: inline-block;
  }
}

/* ===== RTL / HIGH CONTRAST SUPPORT (for future) ===== */
@media (prefers-reduced-motion: reduce) {
  .SPCX-lang-btn,
  .SPCX-lang-menu,
  .SPCX-lang-item,
  .SPCX-lang-banner,
  .SPCX-lang-banner-yes,
  .SPCX-lang-banner-no {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== FIX FOR HEADER OVERFLOW ON SMALL SCREENS ===== */
@media (max-width: 480px) {
  .Header-module__lnUIdW__headerActions {
    gap: 6px !important;
  }
  .Header-module__lnUIdW__headerActions .Header-module__lnUIdW__buyBtn {
    padding: 8px 12px !important;
    font-size: 12.5px !important;
  }
}

/* Ensure switcher doesn't break nav on buy page */
.nav-actions .SPCX-lang-switcher {
  margin-right: 4px;
}