/**
 * ESTILOS PREMIUM PARA RULETA GAMIFICADA
 * Lomas del Uritorco
 */

/* ========================================
   MODAL BASE
   ======================================== */

.ruleta-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.ruleta-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.ruleta-contenido {
  position: relative;
  background: white;
  border-radius: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(139, 92, 246, 0.5);
  animation: slideUp 0.4s ease;
  padding: 40px 30px;
}

.ruleta-cerrar {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f8f9fa;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7f8c8d;
}

.ruleta-cerrar:hover {
  background: #e9ecef;
  transform: rotate(90deg);
  color: #2c3e50;
}

/* ========================================
   STEPS (ESTADOS)
   ======================================== */

.ruleta-step {
  display: none;
}

.ruleta-step.active {
  display: block;
}

/* ========================================
   HEADER
   ======================================== */

.ruleta-header {
  text-align: center;
  margin-bottom: 30px;
}

.ruleta-icon {
  font-size: 5rem;
  margin-bottom: 15px;
  animation: bounce 2s ease infinite;
}

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

.ruleta-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #8B5CF6 0%, #F97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 10px 0;
}

.ruleta-subtitle {
  font-size: 1.2rem;
  color: #7f8c8d;
  margin: 0;
}

/* ========================================
   RULETA CANVAS
   ======================================== */

.ruleta-wrapper {
  margin: 30px 0;
}

.ruleta-canvas-container {
  position: relative;
  width: 400px;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

#ruleta-canvas {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(139, 92, 246, 0.3));
}

.ruleta-pointer {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  color: #F97316;
  filter: drop-shadow(0 4px 8px rgba(249, 115, 22, 0.5));
  z-index: 10;
  animation: pointerPulse 2s ease infinite;
}

@keyframes pointerPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.1); }
}

.ruleta-spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 5px solid #8B5CF6;
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: white;
  font-weight: 800;
  font-size: 1rem;
  cursor: not-allowed;
  transition: all 0.3s;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
  opacity: 0.5;
  z-index: 20;
}

.ruleta-spin-btn.enabled {
  opacity: 1;
  cursor: pointer;
  animation: pulse 1.5s ease infinite;
}

.ruleta-spin-btn.enabled:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.6);
}

.ruleta-spin-btn:active {
  transform: translate(-50%, -50%) scale(0.95);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4); }
  50% { box-shadow: 0 8px 30px rgba(139, 92, 246, 0.7), 0 0 0 10px rgba(139, 92, 246, 0.2); }
}

.spin-btn-text {
  display: block;
  text-align: center;
  line-height: 1.2;
}

/* ========================================
   FORMULARIO
   ======================================== */

.ruleta-form {
  margin-top: 30px;
}

.form-group {
  margin-bottom: 15px;
}

.form-input {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: #8B5CF6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.form-input:valid {
  border-color: #10B981;
}

.form-submit-btn {
  width: 100%;
  padding: 16px 30px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
  margin-top: 10px;
}

.form-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.form-submit-btn:active {
  transform: translateY(0);
}

.form-legal {
  text-align: center;
  font-size: 0.85rem;
  color: #7f8c8d;
  margin-top: 15px;
}

/* ========================================
   RESULTADO - PREMIO GANADO
   ======================================== */

.resultado-container {
  text-align: center;
  padding: 20px;
  position: relative;
}

.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    top: 100%;
    transform: translateX(-50px) rotate(720deg);
    opacity: 0;
  }
}

.premio-icon {
  font-size: 7rem;
  margin-bottom: 20px;
  animation: prizeAppear 0.6s ease;
  position: relative;
  z-index: 2;
}

@keyframes prizeAppear {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.premio-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #2c3e50;
  margin: 0 0 10px 0;
  position: relative;
  z-index: 2;
}

.premio-subtitle {
  font-size: 1.2rem;
  color: #7f8c8d;
  margin: 0 0 20px 0;
  position: relative;
  z-index: 2;
}

.premio-nombre {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #8B5CF6 0%, #F97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 20px 0;
  padding: 15px;
  border-radius: 15px;
  background-image: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(249, 115, 22, 0.1) 100%);
  position: relative;
  z-index: 2;
}

.premio-codigo-container {
  margin: 30px 0;
  position: relative;
  z-index: 2;
}

.premio-codigo-label {
  font-size: 1rem;
  color: #7f8c8d;
  margin-bottom: 10px;
}

.premio-codigo {
  background: #FFD700;
  color: #333;
  padding: 20px 30px;
  font-size: 2rem;
  font-weight: 900;
  border-radius: 12px;
  letter-spacing: 3px;
  margin: 15px auto;
  display: inline-block;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
  font-family: 'Courier New', monospace;
}

.premio-copiar-btn {
  background: #8B5CF6;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  margin-top: 15px;
}

.premio-copiar-btn:hover {
  background: #7C3AED;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.premio-acciones {
  margin: 30px 0 20px 0;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.premio-btn {
  flex: 1;
  min-width: 200px;
  padding: 15px 30px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}

.premio-btn-primary {
  background: linear-gradient(135deg, #8B5CF6 0%, #F97316 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

.premio-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.premio-btn-secondary {
  background: white;
  color: #8B5CF6;
  border: 2px solid #8B5CF6;
}

.premio-btn-secondary:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
}

.premio-terminos {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

/* ========================================
   EST ADO BLOQUEADO
   ======================================== */

.bloqueado-container,
.error-container {
  text-align: center;
  padding: 40px 20px;
}

.bloqueado-icon,
.error-icon {
  font-size: 6rem;
  margin-bottom: 20px;
}

.bloqueado-container h2,
.error-container h2 {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 15px;
}

.bloqueado-container p,
.error-container p {
  font-size: 1.1rem;
  color: #7f8c8d;
  line-height: 1.6;
}

.bloqueado-container a {
  color: #8B5CF6;
  font-weight: 600;
  text-decoration: none;
}

.bloqueado-container a:hover {
  text-decoration: underline;
}

/* ========================================
   ANIMACIONES
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .ruleta-contenido {
    width: 95%;
    padding: 30px 20px;
  }

  .ruleta-title {
    font-size: 2rem;
  }

  .ruleta-icon {
    font-size: 4rem;
  }

  .ruleta-canvas-container {
    width: 100%;
  }

  #ruleta-canvas {
    width: 100%;
    height: auto;
  }

  .ruleta-spin-btn {
    width: 80px;
    height: 80px;
    font-size: 0.85rem;
  }

  .premio-codigo {
    font-size: 1.5rem;
    padding: 15px 20px;
  }

  .premio-acciones {
    flex-direction: column;
  }

  .premio-btn {
    min-width: 100%;
  }

  .premio-icon {
    font-size: 5rem;
  }

  .premio-title {
    font-size: 2rem;
  }

  .premio-nombre {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .ruleta-title {
    font-size: 1.6rem;
  }

  .ruleta-subtitle {
    font-size: 1rem;
  }

  .form-input {
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  .form-submit-btn {
    padding: 14px 25px;
    font-size: 1rem;
  }
}

/* ========================================
   SCROLLBAR PERSONALIZADO
   ======================================== */

.ruleta-contenido::-webkit-scrollbar {
  width: 8px;
}

.ruleta-contenido::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.ruleta-contenido::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #8B5CF6 0%, #F97316 100%);
  border-radius: 10px;
}

.ruleta-contenido::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #7C3AED 0%, #EA580C 100%);
}
