/**
 * Language Switcher Styles
 * Beautiful, accessible language selection UI
 */

#languageSwitcher {
  position: relative;
  z-index: 100;
}

.language-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px; /* Compact padding for flag-only display */
  min-width: 48px; /* Ensure button is large enough for flag */
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.language-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.language-btn .flag {
  font-size: 24px; /* Larger flag since it's the only element */
  line-height: 1;
}

/* HIDE TEXT - SHOW ONLY FLAGS */
.language-btn .lang-name {
  display: none !important;
}

.language-btn i {
  font-size: 12px;
  opacity: 0.6;
  transition: transform 0.3s ease;
}

.language-btn:hover i {
  transform: translateY(2px);
}

/* Language Menu Dropdown - Dark Theme */
.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(99, 102, 241, 0.4);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: menuSlideDown 0.3s ease-out;
  z-index: 1000;
}

@keyframes menuSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.language-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.language-option:last-child {
  border-bottom: none;
}

.language-option:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
  color: #ffffff;
}

.language-option.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.4) 100%);
  font-weight: 600;
  color: #ffffff;
}

.language-option .flag {
  font-size: 24px;
  line-height: 1;
}

.language-option span:not(.flag) {
  flex: 1;
  font-size: 14px;
  color: inherit;
}

.language-option i.fa-check {
  color: #34d399;
  font-size: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .language-btn {
    padding: 6px 12px;
    gap: 6px;
  }

  .language-btn .lang-name {
    display: none;
  }

  .language-btn .flag {
    font-size: 18px;
  }

  .language-menu {
    right: -8px;
  }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .language-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    color: #e2e8f0;
  }

  .language-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    border-color: rgba(99, 102, 241, 0.6);
  }

  .language-menu {
    background: #1e293b;
    border-color: rgba(99, 102, 241, 0.4);
  }

  .language-option {
    color: #e2e8f0;
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .language-option:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  }

  .language-option.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
  }
}

/* Animation for language change */
@keyframes languageChange {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.language-changing {
  animation: languageChange 0.5s ease-in-out;
}

/* Position in header */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right #languageSwitcher {
  margin-left: 8px;
}
