/* Minimal Flag-Only Language Switcher */
.lang-switcher {
  position: fixed;
  top: 80px;
  right: 30px;
  z-index: 999;
}

.lang-current {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(10, 14, 39, 0.95);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lang-current:hover {
  transform: scale(1.1);
  border-color: rgba(102, 126, 234, 0.8);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

.lang-current:active {
  transform: scale(0.95);
}

.lang-dropdown {
  position: absolute;
  top: 60px;
  right: 0;
  background: rgba(10, 14, 39, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 15px;
  border: 2px solid rgba(102, 126, 234, 0.3);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.lang-option {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  position: relative;
}

.lang-option:hover {
  transform: scale(1.15);
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.5);
}

.lang-option:active {
  transform: scale(0.95);
}

.lang-option.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
  border-color: rgba(102, 126, 234, 0.8);
}

.lang-option.active::after {
  content: '✓';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #44ff44;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #0a0e27;
  font-weight: bold;
  border: 2px solid #0a0e27;
}

/* Tooltip on hover */
.lang-option::before {
  content: attr(data-lang-name);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  font-family: 'Poppins', sans-serif;
}

.lang-option:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .lang-switcher {
    top: 70px;
    right: 15px;
  }

  .lang-current {
    width: 45px;
    height: 45px;
    font-size: 1.7rem;
  }

  .lang-dropdown {
    grid-template-columns: repeat(3, 1fr);
    min-width: 160px;
    gap: 6px;
    padding: 8px;
  }

  .lang-option {
    width: 42px;
    height: 42px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .lang-switcher {
    top: 65px;
    right: 10px;
  }

  .lang-current {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .lang-dropdown {
    grid-template-columns: repeat(3, 1fr);
    min-width: 140px;
    gap: 5px;
    padding: 6px;
  }

  .lang-option {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
  }

  .lang-option::before {
    font-size: 0.65rem;
    padding: 3px 6px;
  }
}

/* RTL Support */
html[lang="ar"] .lang-switcher {
  right: auto;
  left: 30px;
}

html[lang="ar"] .lang-dropdown {
  right: auto;
  left: 0;
}

@media (max-width: 768px) {
  html[lang="ar"] .lang-switcher {
    left: 15px;
    right: auto;
  }
}

@media (max-width: 480px) {
  html[lang="ar"] .lang-switcher {
    left: 10px;
    right: auto;
  }
}

/* Animation for opening */
@keyframes dropdownEnter {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lang-dropdown.active {
  animation: dropdownEnter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulse effect on page load */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
  }
}

.lang-current.pulse {
  animation: pulse 2s ease-in-out;
}
