/* PWA Splash Screen Styles */
/* Primary definitions are in config/app-client/styles/themes/default.theme.css */
/* Fallback values reference existing theme variables */
:root {
  /* Fallback definitions using theme variables */
  --splash-background: var(--background, #f5f5f5);
  --splash-gradient-start: var(--background, #f5f5f5);
  --splash-gradient-end: var(--muted, #e8e8e8);
  --splash-accent: var(--accent, #b25ffd);
  --splash-accent-rgb: 178, 95, 253;
  --splash-text-color: var(--muted-foreground, #6b7280);
  --splash-shadow-opacity-light: 0.2;
  --splash-shadow-opacity-medium: 0.3;

  /* Computed shadows using theme variables */
  --splash-icon-shadow-light: 0 8px 24px
    rgba(var(--splash-accent-rgb), var(--splash-shadow-opacity-light));
  --splash-icon-shadow-medium: 0 12px 32px
    rgba(var(--splash-accent-rgb), var(--splash-shadow-opacity-medium));
}

html {
  background-color: var(--splash-background);
}

body {
  background-color: var(--splash-background);
}

#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--splash-gradient-start) 0%,
    var(--splash-gradient-end) 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 9999;
  transition: opacity 0.3s ease-out;
}

#splash-screen.fade-out {
  opacity: 0;
}

.splash-icon {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  box-shadow: var(--splash-icon-shadow-light);
  animation: splash-pulse 2s ease-in-out infinite;
}

.splash-message {
  font-family:
    'SF Pro', 'Noto Sans', 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--splash-text-color);
  text-align: center;
  padding: 0 24px;
  max-width: 320px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.splash-message-text {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.splash-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--splash-accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.splash-indicator-animate {
  animation: splash-streaming-pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes splash-streaming-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.6;
  }
}

@keyframes splash-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: var(--splash-icon-shadow-light);
  }
  50% {
    transform: scale(1.05);
    box-shadow: var(--splash-icon-shadow-medium);
  }
}

/* Dark Mode Support with fallback values */
@media (prefers-color-scheme: dark) {
  :root {
    /* Fallback definitions for dark mode using theme variables */
    --splash-background: var(--background, #1a1a1a);
    --splash-gradient-start: var(--background, #1a1a1a);
    --splash-gradient-end: #0f0f0f;
    --splash-text-color: var(--muted-foreground, #9ca3af);
    --splash-shadow-opacity-light: 0.3;
    --splash-shadow-opacity-medium: 0.4;
  }
}
