/* ===== SPLASH SCREEN CSS MODERNO ===== */

/* Variáveis para o splash screen */
:root {
  --splash-primary: var(--theme-default, #363839);
  --splash-secondary: var(--theme-secondary, #5a5b5c);
  --splash-accent: #474545;
  --splash-gradient: linear-gradient(135deg, var(--splash-primary) 0%, var(--splash-secondary) 50%, var(--splash-accent) 100%);
  --splash-glow: 0 0 40px rgba(54, 56, 57, 0.3);
  --splash-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  --splash-border-radius: 20px;
  --splash-transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Splash Screen Principal */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: var(--splash-transition);
  overflow: hidden;
}

/* Partículas de fundo animadas */
.splash-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(54, 56, 57, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(90, 91, 92, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(71, 69, 69, 0.05) 0%, transparent 50%);
  animation: backgroundFloat 20s ease-in-out infinite;
}

@keyframes backgroundFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(1deg); }
  66% { transform: translateY(10px) rotate(-1deg); }
}

.splash-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

.splash-screen.fade-out {
  opacity: 0;
  transition: var(--splash-transition);
  transform: scale(1.05);
}

/* Container principal modernizado */
.splash-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 450px;
  padding: 3rem 2rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-radius: var(--splash-border-radius);
  box-shadow: var(--splash-shadow);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 10;
  animation: containerSlideIn 1s ease-out 0.2s both;
  overflow: hidden;
}

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

/* Logo modernizado com gradiente */
.splash-logo {
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--splash-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  animation: logoFadeIn 1.2s ease-out 0.4s both;
  position: relative;
  letter-spacing: -0.02em;
  padding: 1rem;
  border-radius: 50%;
  overflow: hidden;
}

@keyframes logoFadeIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logoGlow {
  0%, 100% { 
    filter: blur(15px) brightness(1);
    transform: translate(-50%, -50%) scale(1);
  }
  50% { 
    filter: blur(20px) brightness(1.1);
    transform: translate(-50%, -50%) scale(1.02);
  }
}

/* Subtítulo modernizado */
.splash-subtitle {
  font-size: 1.2rem;
  color: #64748b;
  margin-bottom: 2.5rem;
  font-weight: 500;
  animation: subtitleFadeIn 1s ease-out 0.6s both;
  line-height: 1.6;
  max-width: 320px;
}

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

/* Container de progresso modernizado */
.splash-progress {
  width: 100%;
  margin-bottom: 2rem;
  animation: progressFadeIn 1s ease-out 0.8s both;
}

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

/* Barra de progresso moderna */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
  position: relative;
  --progress: 0%;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: var(--progress);
  height: 100%;
  background: var(--splash-gradient);
  border-radius: 10px;
  animation: progressSlide 1.2s ease-out forwards, progressShine 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(54, 56, 57, 0.5);
}

.progress-bar.active::before {
  left: 0;
  width: var(--progress);
  animation: progressSlide 1.2s ease-out forwards, progressShine 2s ease-in-out infinite;
}

@keyframes progressSlide {
  from {
    left: -100%;
    width: 0%;
  }
  to {
    left: 0;
    width: var(--progress);
  }
}

@keyframes progressShine {
  0%, 100% {
    background: var(--splash-gradient);
  }
  50% {
    background: linear-gradient(135deg, var(--splash-accent) 0%, var(--splash-primary) 50%, var(--splash-secondary) 100%);
  }
}

/* Indicadores de status modernizados */
.status-indicators {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 350px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.4;
  transition: var(--splash-transition);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-item.active {
  opacity: 1;
  color: var(--splash-primary);
  background: rgba(54, 56, 57, 0.1);
  border-color: rgba(54, 56, 57, 0.2);
  transform: translateX(10px);
  box-shadow: 0 4px 12px rgba(54, 56, 57, 0.15);
}

.status-item.completed {
  opacity: 0.8;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

/* Ícones de status modernizados */
.status-icon {
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: var(--splash-transition);
}

.status-icon.loading {
  border-color: var(--splash-primary);
  animation: spin 1.2s linear infinite;
  box-shadow: 0 0 10px rgba(54, 56, 57, 0.3);
}

.status-icon.completed {
  border-color: #10b981;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  animation: iconPop 0.6s ease-out;
}

.status-icon.completed::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
  animation: checkmarkPop 0.4s ease-out 0.2s both;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes iconPop {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes checkmarkPop {
  0% { 
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
  }
  100% { 
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Responsividade melhorada */
@media (max-width: 768px) {
  .splash-container {
    padding: 2rem 1.5rem;
    max-width: 350px;
    margin: 0 1rem;
  }
  
  .splash-logo {
    font-size: 3rem;
  }
  
  .splash-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }
  
  .status-indicators {
    max-width: 300px;
  }
  
  .status-item {
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .splash-logo {
    font-size: 2.5rem;
  }
  
  .splash-subtitle {
    font-size: 1rem;
  }
  
  .splash-container {
    padding: 1.5rem 1rem;
    max-width: 300px;
  }
  
  .status-item {
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
  }
}

/* Tema escuro modernizado */
.dark-only .splash-screen {
  background: linear-gradient(135deg, #292929 0%, #363839 50%, #5a5b5c 100%);
}

.dark-only .splash-screen::before {
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(54, 56, 57, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(90, 91, 92, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(71, 69, 69, 0.1) 0%, transparent 50%);
}

.dark-only .splash-container {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.dark-only .splash-subtitle {
  color: #94a3b8;
}

.dark-only .progress-bar {
  background: #334155;
}

.dark-only .status-item {
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.dark-only .status-item.active {
  background: rgba(54, 56, 57, 0.2);
  border-color: rgba(54, 56, 57, 0.3);
  color: var(--splash-primary);
}

.dark-only .status-item.completed {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

/* Animação de saída suave */
.splash-screen.exiting {
  animation: fadeOutUp 1s ease-out forwards;
}

@keyframes fadeOutUp {
  to {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
}

/* Efeito de blur para transição */
.splash-screen.blurring {
  filter: blur(10px);
  opacity: 0;
  transition: all 0.8s ease-out;
}

/* Loading spinner adicional */
.splash-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 4px solid rgba(54, 56, 57, 0.1);
  border-top: 4px solid var(--splash-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 5;
}

/* Pulse effect para elementos ativos */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* --- ANIMAÇÕES SUAVES SPLASH --- */
.splash-screen {
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), filter 0.7s, transform 0.7s;
}
.splash-screen.exiting {
  animation: fadeOutUp 1s cubic-bezier(0.4,0,0.2,1) forwards;
}
.splash-loading-spinner {
  animation: spin 1s linear infinite, fadeInSpinner 0.7s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes fadeInSpinner {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}
.progress-bar::before {
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1), background 0.7s;
}
.status-item {
  transition: background 0.4s, color 0.4s, opacity 0.4s, transform 0.4s;
}
.status-icon.completed {
  animation: iconPop 0.6s cubic-bezier(0.4,0,0.2,1);
}
.status-icon.completed::after {
  animation: checkmarkPop 0.4s cubic-bezier(0.4,0,0.2,1) 0.2s both;
}