/* Language Selection Modal Styles */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.language-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease-out;
}

.language-modal-container {
  background: #29272A;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 420px;
  width: 100%;
  overflow: hidden;
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(252, 112, 234, 0.15);
}

.language-modal-header {
  background: linear-gradient(135deg, #7733FE 0%, #FC70EA 100%);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.language-modal-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}

.language-modal-icon {
  font-size: 56px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  animation: float 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.language-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.language-modal-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.language-modal-content {
  padding: 24px;
}

.language-detected-section {
  margin-bottom: 24px;
}

.language-section-label {
  font-size: 13px;
  font-weight: 600;
  color: #99999d;
  text-align: center;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.language-option-detected {
  width: 100%;
  background: linear-gradient(135deg, rgba(119, 51, 254, 0.08) 0%, rgba(252, 112, 234, 0.08) 100%);
  border: 2px solid #7733FE;
  border-radius: 20px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.language-option-detected::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.language-option-detected:hover::before {
  left: 100%;
}

.language-option-detected:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(119, 51, 254, 0.35);
  border-color: #FC70EA;
}

.language-option-detected:active {
  transform: translateY(0);
}

.language-option-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.language-option-flag {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.language-option-text {
  text-align: left;
}

.language-option-native {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
  line-height: 1.2;
}

.language-option-name {
  font-size: 13px;
  color: #99999d;
  line-height: 1.2;
}

.language-option-badge {
  background: linear-gradient(135deg, #7733FE 0%, #FC70EA 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(119, 51, 254, 0.4);
  letter-spacing: 0.3px;
}

.language-divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
  height: 1px;
  background: rgba(252, 112, 234, 0.15);
}

.language-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #29272A;
  padding: 0 16px;
  font-size: 12px;
  color: #636366;
  text-transform: lowercase;
  font-style: italic;
}

.language-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.language-list::-webkit-scrollbar {
  width: 6px;
}

.language-list::-webkit-scrollbar-track {
  background: #29272A;
  border-radius: 10px;
}

.language-list::-webkit-scrollbar-thumb {
  background: rgba(252, 112, 234, 0.15);
  border-radius: 10px;
  transition: background 0.2s;
}

.language-list::-webkit-scrollbar-thumb:hover {
  background: #636366;
}

.language-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #29272A;
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.language-option:hover {
  background: #3a3739;
  border-color: rgba(252, 112, 234, 0.15);
  transform: translateX(4px);
}

.language-option:active {
  transform: translateX(2px);
}

.language-option .language-option-flag {
  font-size: 28px;
}

.language-option .language-option-native {
  font-size: 15px;
  font-weight: 600;
}

.language-option .language-option-name {
  font-size: 12px;
}

/* Responsive adjustments for language modal */
@media (max-width: 640px) {
  .language-modal-container {
    max-width: 100%;
    margin: 0 8px;
  }

  .language-modal-header {
    padding: 24px 20px;
  }

  .language-modal-icon {
    font-size: 48px;
  }

  .language-modal-title {
    font-size: 19px;
  }

  .language-modal-subtitle {
    font-size: 13px;
  }

  .language-modal-content {
    padding: 20px;
  }

  .language-option-flag {
    font-size: 32px !important;
  }

  .language-option-native {
    font-size: 16px !important;
  }

  .language-list {
    max-height: 240px;
  }
}