/* ==========================================================================
   COMPONENT: PREMIUM BRANDED LOADING SCREEN
   Business: Karthi Maligai (கார்த்தி மளிகை)
   Design: Warm cream background, logo scale-in, elegant typography, minimal progress bar
   ========================================================================== */

/* Main Fullscreen Loading Container */
.loading-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background-color: var(--bg-warm, #FAF9F6);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  pointer-events: auto;
  user-select: none;
}

/* Card Wrapper */
.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 480px;
  width: 100%;
}

/* Logo Image Container & Animation */
.loading-logo-wrap {
  margin-bottom: 1.5rem;
}

.loading-logo-img {
  height: 150px;
  width: auto;
  max-width: 85vw;
  object-fit: contain;
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 12px 32px rgba(13, 83, 55, 0.12);
  animation: loadingLogoFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Tamil Brand Name Animation */
.loading-title-tamil {
  font-family: var(--font-sans);
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--brand-green, #0D5337);
  line-height: 1.2;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: loadingTextFade 0.55s ease-out 0.2s forwards;
}

/* English Subtitle Animation */
.loading-subtitle-english {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-red, #D32F2F);
  margin: 0 0 2rem 0;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: loadingTextFade 0.55s ease-out 0.35s forwards;
}

/* Minimalist Progress Line */
.loading-bar-wrap {
  width: 170px;
  height: 4px;
  background-color: var(--brand-green-light, #EBF4F0);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

.loading-bar-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-green, #0D5337), var(--brand-red, #D32F2F));
  border-radius: 99px;
  width: 0%;
  animation: loadingProgress 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}

/* Fade Out State */
.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Keyframes */
@keyframes loadingLogoFade {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes loadingProgress {
  0% {
    width: 0%;
  }
  50% {
    width: 65%;
  }
  100% {
    width: 100%;
  }
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .loading-logo-img,
  .loading-title-tamil,
  .loading-subtitle-english,
  .loading-bar-progress {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .loading-bar-progress {
    width: 100% !important;
  }
  .loading-screen {
    transition: opacity 0.2s linear, visibility 0.2s linear;
  }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .loading-logo-img {
    height: 110px;
  }
  .loading-title-tamil {
    font-size: 1.75rem;
  }
  .loading-subtitle-english {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
  .loading-bar-wrap {
    width: 130px;
  }
}
