/* Splash Screen Styles - Calibrix */
/* Customize colors, sizes, and animations here */

:root {
  --splash-bg-color: #0d1526;
  --splash-accent: #1eb2f8;
  --splash-accent-light: rgba(30, 178, 248, 0.2);
  --spinner-size: 60px;
  --logo-size: 120px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--splash-bg-color);
  overflow: hidden;
}

#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0d1526 0%, #1a2642 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

#loading-content {
  text-align: center;
  animation: fadeInUp 0.6s ease-out;
}

/* Logo Container */
#loading-logo {
  width: var(--logo-size);
  height: var(--logo-size);
  margin: 0 auto 32px;
  position: relative;
  animation: pulse 2s ease-in-out infinite;
}

#loading-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Removed drop-shadow for clean logo appearance */
}

/* If image fails to load, show a styled fallback */
#loading-logo-fallback {
  display: none;
  width: var(--logo-size);
  height: var(--logo-size);
  margin: 0 auto 32px;
  background: linear-gradient(135deg, var(--splash-accent) 0%, #0ea5e9 100%);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(30, 178, 248, 0.4);
  animation: pulse 2s ease-in-out infinite;
  position: relative;
}

#loading-logo-fallback::before {
  content: "C";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* App Title */
#loading-title {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#loading-subtitle {
  margin: 0 0 40px 0;
  font-size: 14px;
  font-weight: 400;
  color: #94a3b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Modern Spinner */
.spinner-container {
  position: relative;
  width: var(--spinner-size);
  height: var(--spinner-size);
  margin: 0 auto;
}

.spinner {
  width: var(--spinner-size);
  height: var(--spinner-size);
  border: 3px solid var(--splash-accent-light);
  border-top-color: var(--splash-accent);
  border-right-color: var(--splash-accent);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  box-shadow: 0 0 20px rgba(30, 178, 248, 0.2);
}

.spinner::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(var(--spinner-size) - 20px);
  height: calc(var(--spinner-size) - 20px);
  border: 2px solid transparent;
  border-top-color: var(--splash-accent);
  border-radius: 50%;
  animation: spin 1.5s linear infinite reverse;
}

/* Loading Dots */
.loading-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

.dot {
  width: 8px;
  height: 8px;
  background-color: var(--splash-accent);
  border-radius: 50%;
  animation: dotPulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(30, 178, 248, 0.5);
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

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

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

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

@keyframes dotPulse {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Fade out animation when Flutter loads */
#loading.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --logo-size: 100px;
    --spinner-size: 50px;
  }

  #loading-title {
    font-size: 24px;
  }

  #loading-subtitle {
    font-size: 12px;
  }
}
