/**
 * Estilos para el Overlay
 * Sistema de capas y animaciones
 */

/* ===================================
   Overlay Container
   =================================== */
.app-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(32, 0, 32, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.app-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===================================
   Overlay Content
   =================================== */
.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  max-width: 90%;
  padding: 2rem;
  animation: slideUp 0.4s ease-out;
}

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

/* ===================================
   Logo Animation
   =================================== */
.overlay-spinner {
  position: relative;
  width: 120px;
  height: 120px;
}

.overlay-logo {
  width: 100%;
  height: 100%;
  animation: pulse-logo 1.5s ease-in-out infinite;
}

.overlay-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes pulse-logo {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* ===================================
   Success Icon
   =================================== */
.success-icon {
  width: 80px;
  height: 80px;
}

.success-circle {
  stroke: #4caf50;
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-check {
  stroke: #4caf50;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

/* ===================================
   Error Icon
   =================================== */
.error-icon {
  width: 80px;
  height: 80px;
}

.error-circle {
  stroke: #f44336;
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.error-x {
  stroke: #f44336;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 54;
  stroke-dashoffset: 54;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

/* ===================================
   Overlay Message
   =================================== */
.overlay-message {
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
  margin: 0;
  font-family: 'Manrope', sans-serif;
  line-height: 1.5;
  animation: fadeIn 0.5s ease-out;
}

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

/* ===================================
   Progress Bar
   =================================== */
.overlay-progress-bar {
  width: 250px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #da0081, #fbe5f2);
  border-radius: 2px;
  transition: width 0s linear;
  box-shadow: 0 0 10px rgba(218, 0, 129, 0.5);
}

/* ===================================
   Pulse Animation
   =================================== */
.overlay-content::before {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(218, 0, 129, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  z-index: -1;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
  .overlay-content {
    padding: 1.5rem;
    gap: 1.25rem;
  }

  .overlay-spinner {
    width: 60px;
    height: 60px;
  }

  .success-icon,
  .error-icon {
    width: 60px;
    height: 60px;
  }

  .overlay-message {
    font-size: 1rem;
  }

  .overlay-progress-bar {
    width: 200px;
  }
}

@media (max-width: 480px) {
  .overlay-content {
    padding: 1rem;
    gap: 1rem;
  }

  .overlay-spinner {
    width: 50px;
    height: 50px;
  }

  .success-icon,
  .error-icon {
    width: 50px;
    height: 50px;
  }

  .overlay-message {
    font-size: 0.9375rem;
  }

  .overlay-progress-bar {
    width: 150px;
    height: 3px;
  }
}

/* ===================================
   Accessibility
   =================================== */
@media (prefers-reduced-motion: reduce) {
  .app-overlay,
  .overlay-content,
  .spinner-ring,
  .success-circle,
  .success-check,
  .error-circle,
  .error-x,
  .overlay-message,
  .progress-bar-fill,
  .overlay-content::before {
    animation: none !important;
    transition: none !important;
  }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
  .app-overlay {
    display: none !important;
  }
}
