/* ============================================
   LANGUAGE SWITCHER - Zebridge Theme
   Styled to match Zidex/Bootstrap 3 navbar
   ============================================ */

/* Container in nav menu */
.lang-switcher {
  position: relative;
}

.lang-switcher > a.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lang-switcher > a.lang-current::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 4px;
  transition: transform 0.3s ease;
}

.lang-switcher:hover > a.lang-current::after {
  transform: rotate(180deg);
}

/* Flag image next to language code */
.lang-flag {
  display: inline-block;
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: middle;
  box-shadow: 0 0 1px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

/* Dropdown list */
.lang-switcher ul.lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  min-width: 160px;
  padding: 8px 0;
  margin: 0;
  list-style: none;
  background: #1a1a2e;
  border: 1px solid rgba(255, 183, 22, 0.3);
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.lang-switcher:hover ul.lang-dropdown {
  display: block;
  animation: langDropIn 0.25s ease-out;
}

@keyframes langDropIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dropdown items */
.lang-switcher ul.lang-dropdown li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang-switcher ul.lang-dropdown li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.lang-switcher ul.lang-dropdown li a:hover {
  background: rgba(255, 183, 22, 0.15);
  color: #FFB716;
}

.lang-switcher ul.lang-dropdown li a.lang-active {
  background: rgba(255, 183, 22, 0.2);
  color: #FFB716;
  font-weight: 700;
}

.lang-switcher ul.lang-dropdown li a.lang-active::before {
  content: '\2713';
  font-weight: 700;
  margin-right: 2px;
}

/* Language name label */
.lang-name {
  flex: 1;
}

/* ============================================
   RESPONSIVE - Mobile nav
   ============================================ */
@media (max-width: 991px) {
  .lang-switcher {
    position: static;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 5px;
    padding-top: 5px;
    width: 100%;
  }
  
  .lang-switcher > a.lang-current {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    min-height: 44px; /* Touch-friendly */
  }
  
  .lang-switcher ul.lang-dropdown {
    position: static;
    display: none;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    animation: none;
    width: 100%;
    min-width: unset;
  }
  
  .lang-switcher:hover ul.lang-dropdown,
  .lang-switcher.open ul.lang-dropdown {
    display: block;
  }
  
  .lang-switcher ul.lang-dropdown li a {
    padding: 10px 30px;
    font-size: 14px;
    min-height: 44px; /* Touch-friendly */
  }
}

/* ============================================
   TRANSITION OVERLAY (optional flash)
   ============================================ */
.lang-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 26, 46, 0.5);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lang-transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lang-transition-overlay .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 183, 22, 0.3);
  border-top-color: #FFB716;
  border-radius: 50%;
  animation: langSpin 0.6s linear infinite;
}

@keyframes langSpin {
  to { transform: rotate(360deg); }
}
