/* ============================================
   PREMIUM LANGUAGE SELECTOR POPUP
   ============================================ */

.premium-lang-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: all 0.5s ease;
}

.premium-lang-popup.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Animated Background */
.lang-popup-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.lang-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    #0f0f1a 0%, 
    #1a1a2e 25%, 
    #16213e 50%, 
    #1a1a2e 75%, 
    #0f0f1a 100%);
  animation: gradientShift 10s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.lang-bg-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(239, 55, 36, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
}

/* Floating Particles */
.lang-bg-particles {
  position: absolute;
  inset: 0;
}

.lang-bg-particles span {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: floatParticle 15s infinite ease-in-out;
}

.lang-bg-particles span:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.lang-bg-particles span:nth-child(2) { left: 20%; top: 80%; animation-delay: 2s; }
.lang-bg-particles span:nth-child(3) { left: 35%; top: 50%; animation-delay: 4s; }
.lang-bg-particles span:nth-child(4) { left: 50%; top: 15%; animation-delay: 6s; }
.lang-bg-particles span:nth-child(5) { left: 65%; top: 70%; animation-delay: 8s; }
.lang-bg-particles span:nth-child(6) { left: 75%; top: 30%; animation-delay: 10s; }
.lang-bg-particles span:nth-child(7) { left: 85%; top: 85%; animation-delay: 1s; }
.lang-bg-particles span:nth-child(8) { left: 90%; top: 45%; animation-delay: 3s; }
.lang-bg-particles span:nth-child(9) { left: 5%; top: 60%; animation-delay: 5s; }
.lang-bg-particles span:nth-child(10) { left: 45%; top: 90%; animation-delay: 7s; }

@keyframes floatParticle {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
  50% { transform: translateY(-100px) scale(1.5); opacity: 0.8; }
}

/* Popup Card */
.lang-popup-card {
  position: relative;
  width: 90%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px 35px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5),
              0 0 100px rgba(239, 55, 36, 0.1);
  animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Card Glow */
.lang-card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(239, 55, 36, 0.3), transparent, rgba(255, 215, 0, 0.3), transparent);
  animation: rotateGlow 8s linear infinite;
  opacity: 0.5;
}

@keyframes rotateGlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.lang-popup-card::before {
  content: '';
  position: absolute;
  inset: 1px;
  background: rgba(15, 15, 26, 0.9);
  border-radius: 23px;
  z-index: 0;
}

/* Header */
.lang-popup-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 35px;
}

.lang-icon-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-icon-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ef3724, #ffd700);
  border-radius: 50%;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.2); opacity: 0.1; }
}

.lang-icon {
  position: relative;
  font-size: 2.5rem;
  z-index: 1;
  animation: iconFloat 3s ease-in-out infinite;
}

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

.lang-popup-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 0 10px;
}

.title-ja {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #ef3724 50%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-en {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.lang-popup-subtitle {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  margin: 0;
}

/* Language Options */
.lang-options {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.lang-option-btn {
  position: relative;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.lang-option-btn:hover {
  transform: translateX(5px) scale(1.02);
}

.lang-option-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.lang-option-btn:hover .lang-option-bg {
  background: linear-gradient(135deg, rgba(239, 55, 36, 0.2), rgba(255, 215, 0, 0.1));
  border-color: rgba(239, 55, 36, 0.3);
  box-shadow: 0 10px 30px rgba(239, 55, 36, 0.2);
}

.lang-option-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 20px;
  z-index: 1;
}

.lang-flag-large {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.lang-option-btn:hover .lang-flag-large {
  transform: scale(1.15) rotate(-5deg);
}

.lang-option-text {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
  transition: color 0.3s ease;
}

.lang-option-btn:hover .lang-name {
  background: linear-gradient(90deg, #fff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lang-native {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.lang-option-arrow {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.lang-option-btn:hover .lang-option-arrow {
  background: linear-gradient(135deg, #ef3724, #ffd700);
  color: white;
  transform: translateX(5px);
}

.lang-option-shine {
  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 ease;
}

.lang-option-btn:hover .lang-option-shine {
  left: 100%;
}

/* Footer */
.lang-popup-footer {
  position: relative;
  z-index: 1;
  margin-top: 30px;
  text-align: center;
}

.lang-footer-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #ef3724, #ffd700);
  border-radius: 2px;
  margin: 0 auto 15px;
}

.lang-footer-text {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 480px) {
  .lang-popup-card {
    padding: 30px 25px;
    border-radius: 20px;
  }

  .lang-icon-container {
    width: 65px;
    height: 65px;
  }

  .lang-icon {
    font-size: 2rem;
  }

  .title-ja {
    font-size: 1.5rem;
  }

  .title-en {
    font-size: 0.95rem;
  }

  .lang-option-content {
    padding: 15px;
  }

  .lang-flag-large {
    font-size: 2rem;
  }

  .lang-name {
    font-size: 1.1rem;
  }
}

/* Hide old popup styles */
.popup:not(.premium-lang-popup) {
  display: none !important;
}

