/* ============================================================
   AGI DeFi Platform — Language Switcher Styles
   ============================================================ */


/* ============================
   LANGUAGE BUTTON (Header)
   ============================ */

.lang-switcher {
  position: relative;
}

/* Desktop Dropdown Trigger */
.lang-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--c-text-secondary);
  background: transparent;
  border: 1px solid var(--c-border-subtle);
  cursor: pointer;
  transition: var(--t-fast);
  height: 34px;
  white-space: nowrap;
}
.lang-dropdown-trigger:hover {
  color: var(--c-text-primary);
  border-color: var(--c-border);
  background: rgba(255,255,255,0.04);
}
.lang-dropdown-trigger .lang-code {
  font-family: var(--font-data);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lang-dropdown-trigger i {
  font-size: 11px;
  transition: transform 0.2s ease;
}
.lang-switcher.open .lang-dropdown-trigger i {
  transform: rotate(180deg);
}

/* ============================
   DESKTOP DROPDOWN MENU
   ============================ */

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card), 0 8px 32px rgba(0,0,0,0.30);
  min-width: 160px;
  overflow: hidden;
  z-index: var(--z-dropdown);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.20s ease, transform 0.20s ease;
}
.lang-switcher.open .lang-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.lang-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 14px;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  transition: var(--t-fast);
  white-space: nowrap;
}
.lang-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--c-text-primary);
}
.lang-item.active {
  color: var(--c-primary);
  background: rgba(255,107,43,0.08);
}
.lang-item .lang-flag {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.lang-item .lang-name {
  flex: 1;
  font-weight: 500;
}
.lang-item .lang-check {
  color: var(--c-primary);
  font-size: 12px;
  opacity: 0;
  flex-shrink: 0;
}
.lang-item.active .lang-check {
  opacity: 1;
}


/* ============================
   MOBILE BOTTOM SHEET (Language)
   ============================ */

#lang-bottom-sheet-wrapper {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-bottom-sheet);
  pointer-events: none;
}
#lang-bottom-sheet-wrapper.active {
  pointer-events: all;
}

#lang-bottom-sheet {
  background: var(--c-bg-surface);
  border-top: 1px solid var(--c-border);
  border-top-left-radius: var(--r-2xl);
  border-top-right-radius: var(--r-2xl);
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + var(--sp-3));
  box-shadow: 0 -8px 40px rgba(0,0,0,0.50);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}
#lang-bottom-sheet-wrapper.active #lang-bottom-sheet {
  transform: translateY(0);
}

.lang-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 6px;
}
.lang-sheet-handle::after {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--r-full);
}

.lang-sheet-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--c-text-primary);
  padding: var(--sp-2) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--c-border-subtle);
}

.lang-sheet-list {
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-sheet-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--t-fast);
}
.lang-sheet-item:hover {
  background: rgba(255,255,255,0.04);
}
.lang-sheet-item.active {
  background: rgba(255,107,43,0.10);
}
.lang-sheet-item .ls-flag {
  font-size: 22px;
  line-height: 1;
}
.lang-sheet-item .ls-name {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--c-text-secondary);
  flex: 1;
}
.lang-sheet-item.active .ls-name {
  color: var(--c-primary);
  font-weight: 600;
}
.lang-sheet-item .ls-native {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}
.lang-sheet-item .ls-check {
  font-size: 14px;
  color: var(--c-primary);
  opacity: 0;
}
.lang-sheet-item.active .ls-check {
  opacity: 1;
}
