/* ======================================
   ROOT INDEX - SPLASH SCREEN PREMIUM
   Vallenar ERP - Production Ready
   ====================================== */

/* ======================================
   MAIN CONTAINER
====================================== */
.splash-main {
  min-height: calc(100vh - var(--header-height, 80px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-4);
  position: relative;
  overflow: hidden;
}

/* ======================================
   AMBIENT BACKGROUND
====================================== */
.splash-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.splash-ambient::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  top: -200px;
  left: -200px;
  background: radial-gradient(circle, rgba(30, 107, 214, 0.08) 0%, transparent 70%);
  animation: ambientFloat 12s ease-in-out infinite;
}

.splash-ambient::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  bottom: -150px;
  right: -150px;
  background: radial-gradient(circle, rgba(90, 200, 250, 0.06) 0%, transparent 70%);
  animation: ambientFloat 15s ease-in-out infinite reverse;
}

/* ======================================
   SPLASH CONTENT WRAPPER
====================================== */
.splash-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 480px;
  opacity: 0;
  animation: contentReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

/* ======================================
   LOGO CONTAINER
====================================== */
.splash-logo-container {
  position: relative;
  margin-bottom: var(--spacing-5);
}

.splash-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(30, 107, 214, 0.15));
  animation: logoFloat 4s ease-in-out infinite;
  will-change: transform;
}

.splash-logo-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(30, 107, 214, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

/* ======================================
   TYPOGRAPHY
====================================== */
.splash-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 var(--spacing-3);
  background: linear-gradient(135deg, #1e6bd6 0%, #3b82f6 50%, #5ac8fa 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease infinite;
}

.splash-tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  font-weight: 400;
  margin: 0 0 var(--spacing-5);
  opacity: 0;
  animation: fadeInUp 0.6s ease-out 0.6s forwards;
}

/* ======================================
   PROGRESS INDICATOR
====================================== */
.splash-progress {
  width: 200px;
  height: 3px;
  background: rgba(30, 107, 214, 0.1);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.4s ease-out 0.8s forwards;
}

.splash-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1e6bd6 0%, #5ac8fa 100%);
  border-radius: 2px;
  animation: progressFill 2.2s cubic-bezier(0.4, 0, 0.2, 1) 1s forwards;
}

/* ======================================
   VERSION BADGE
====================================== */
.splash-version {
  position: absolute;
  bottom: var(--spacing-5);
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  opacity: 0;
  animation: fadeIn 0.5s ease-out 1.2s forwards;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ======================================
   KEYFRAME ANIMATIONS
====================================== */
@keyframes contentReveal {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

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

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes progressFill {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

@keyframes ambientFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -20px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 10px) scale(0.95);
  }
}

/* ======================================
   DARK THEME
====================================== */
[data-theme="dark"] .splash-ambient::before {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
}

[data-theme="dark"] .splash-ambient::after {
  background: radial-gradient(circle, rgba(90, 200, 250, 0.08) 0%, transparent 70%);
}

[data-theme="dark"] .splash-logo {
  filter: drop-shadow(0 20px 40px rgba(59, 130, 246, 0.25));
}

[data-theme="dark"] .splash-logo-glow {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
}

[data-theme="dark"] .splash-progress {
  background: rgba(59, 130, 246, 0.15);
}

/* ======================================
   ACCESSIBILITY - REDUCED MOTION
====================================== */
@media (prefers-reduced-motion: reduce) {
  .splash-logo,
  .splash-logo-glow,
  .splash-ambient::before,
  .splash-ambient::after,
  .splash-title {
    animation: none !important;
  }

  .splash-content {
    animation: fadeIn 0.3s ease-out forwards !important;
  }

  .splash-tagline {
    animation: fadeIn 0.3s ease-out 0.1s forwards !important;
  }

  .splash-progress-bar {
    animation: progressFill 2s linear 0.2s forwards !important;
  }
}

/* ======================================
   RESPONSIVE
====================================== */
@media (max-width: 768px) {
  .splash-main {
    padding: var(--spacing-3);
  }

  .splash-logo {
    width: 130px;
    height: 130px;
  }

  .splash-logo-container {
    margin-bottom: var(--spacing-4);
  }

  .splash-progress {
    width: 160px;
  }

  .splash-ambient::before,
  .splash-ambient::after {
    animation: none;
  }
}

@media (max-width: 480px) {
  .splash-logo {
    width: 110px;
    height: 110px;
  }

  .splash-progress {
    width: 140px;
  }
}

/* ======================================
   HIGH CONTRAST
====================================== */
[data-theme="contrast"] .splash-title {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--text-dark);
}

[data-theme="contrast"] .splash-progress {
  background: var(--color-border);
  border: 2px solid var(--text-dark);
}

[data-theme="contrast"] .splash-progress-bar {
  background: var(--text-dark);
}
