/* TrackVAS PWA Splash Screen Styles */

body.page-loading {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

.splash-screen {
  display: none;
}

.page-loading .splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: Inter, Helvetica, 'sans-serif';
  background: linear-gradient(135deg, #f9f9f9 0%, #e8e8f0 100%);
  color: #5e6278;
  line-height: 1;
  font-size: 14px;
  font-weight: 400;
  transition: opacity 0.3s ease-out;
}

/* Logo Container with Animation */
.page-loading .splash-screen .logo-container {
  position: relative;
  margin-bottom: 50px;
  animation: logoEntrance 0.8s ease-out;
}

@keyframes logoEntrance {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(-30px);
  }
  60% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.page-loading .splash-screen img {
  margin-left: calc(100vw - 100%);
  height: 60px !important;
  width: auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.1));
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Text Styling with Animation */
.page-loading .splash-screen span {
  color: #5e6278;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-top: 20px;
  -webkit-font-smoothing: antialiased;
  animation: textFadeIn 0.8s ease-out 0.3s both;
}

@keyframes textFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Spinner */
.page-loading .splash-screen::after {
  content: '';
  position: absolute;
  bottom: 30%;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(94, 98, 120, 0.1);
  border-top-color: #5e6278;
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Decorative Elements */
.page-loading .splash-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 80%, rgba(94, 98, 120, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(94, 98, 120, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* Dark Theme */
html[data-bs-theme='dark'] .page-loading .splash-screen {
  background: linear-gradient(135deg, #151521 0%, #1a1a2e 100%);
  color: #ffffff;
}

html[data-bs-theme='dark'] .page-loading .splash-screen span {
  color: #ffffff;
}

html[data-bs-theme='dark'] .page-loading .splash-screen::after {
  border-color: rgba(255, 255, 255, 0.1);
  border-top-color: #ffffff;
}

html[data-bs-theme='dark'] .page-loading .splash-screen::before {
  background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

html[data-bs-theme='dark'] .page-loading .splash-screen img {
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

/* Logo Theme Toggle */
.splash-screen .dark-logo {
  display: none;
}

.splash-screen .light-logo {
  display: block;
}

html[data-bs-theme='dark'] .splash-screen .light-logo {
  display: none;
}

html[data-bs-theme='dark'] .splash-screen .dark-logo {
  display: block;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .page-loading .splash-screen img {
    height: 50px !important;
  }

  .page-loading .splash-screen span {
    font-size: 14px;
    padding: 0 20px;
    text-align: center;
  }

  .page-loading .splash-screen::after {
    bottom: 25%;
    width: 35px;
    height: 35px;
  }
}

/* Fade Out Animation */
.splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}
