/* =========================================================================
   PREMIUM CORPORATE SPLASH SCREEN LOADER - UNIFIED FULLSCREEN SVG
   ========================================================================= */

:root {
  --loader-bg: #ffffff; /* Clean corporate white */
  --loader-primary: #2563eb; /* Brand Blue */
  --loader-primary-glow: rgba(37, 99, 235, 0.15);
  --loader-secondary: #60a5fa; /* Light Brand Blue */
  --loader-dark: #0f172a; /* Slate Dark */
  --loader-accent: #f8fafc;
}

/* 1. Main Overlay Container */
.cinematic-loader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--loader-bg);
  z-index: 999990; /* Sits below app-content during reveal */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* Prevent body scrolling when loader is active */
body.loader-active {
  overflow: hidden !important;
  height: 100vh !important;
}

/* Scoped initial state of main site content when preloader is active */
body.loader-active #app-content {
  opacity: 0;
  clip-path: circle(0% at 50vw 50vh);
  transform: scale(0.97);
  transform-origin: center 50vh;
  filter: blur(8px);
  z-index: 999995; /* Sits on top of preloader background cover during reveal */
  position: relative; /* Ensure z-index takes effect */
  will-change: clip-path, opacity, transform, filter;
}

/* Navbar is outside #app-content — always sits above loader */
.navbar {
  z-index: 9999999 !important;
}

/* Safety overrides when loader terminates */
body:not(.loader-active) #app-content {
  opacity: 1 !important;
  transform: none !important;
  transform-origin: center !important;
  filter: none !important;
  clip-path: none !important;
  z-index: auto !important;
  position: static !important;
}

/* 2. Soft Corporate Ambient Glow */
.loader-ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--loader-primary-glow) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.6;
  z-index: 1;
  pointer-events: none;
}

/* Glowing ripple circle wave that radiates outward */
.loader-ripple-ring {
  position: fixed; /* Always fixed on viewport overlay */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 120px;
  height: 120px;
  border: 3px solid #cbd5e1;
  box-shadow: 0 0 35px rgba(203, 213, 225, 0.45), inset 0 0 35px rgba(203, 213, 225, 0.45);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 9999999; /* Stays visible on top of app content reveal */
  will-change: transform, opacity;
}

/* 3. Fullscreen SVG styles */
.se-svg-loader {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  display: block;
  pointer-events: none;
  overflow: visible;
}

.se-svg-loader path {
  vector-effect: non-scaling-stroke; /* Keeps stroke width uniform when resizing */
}

/* Premium Sleek Laser Beams */
.maze-path {
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  will-change: stroke-dashoffset, opacity;
  filter: drop-shadow(0 0 5px rgba(37, 99, 235, 0.35));
}

/* SVG Initials Text elements for outline drawing */
.svg-letter-text {
  font-family: 'Outfit', sans-serif;
  font-size: 110px;
  font-weight: 900;
  text-transform: uppercase;
  will-change: stroke-dashoffset, fill, stroke-width;
}

/* SVG Text elements (drawn outline) */
.svg-expand-text {
  font-family: 'Outfit', sans-serif;
  font-size: 110px;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 1; /* Keep text structure visible (characters within text are animated) */
}

/* Inner tspan characters staggered opacity */
.svg-expand-text .char {
  opacity: 0;
  will-change: opacity;
}

/* Subtitle styling */
.svg-subtitle-text {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 9px;
  text-transform: uppercase;
  opacity: 0;
  will-change: opacity, transform;
}

/* Center flash overlay */
.loader-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.45) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

/* ═══════════════════ MOBILE RESPONSIVE PRELOADER ═══════════════════ */
@media (max-width: 768px) {
  .loader-ambient-glow {
    width: 320px !important;
    height: 320px !important;
    filter: blur(40px) !important;
  }

  .loader-flash {
    width: 180px !important;
    height: 180px !important;
  }

  .loader-ripple-ring {
    width: 90px !important;
    height: 90px !important;
  }

  .se-svg-loader {
    width: 100% !important;
    height: 100% !important;
  }

  /* Optimize font rendering on small mobile screens */
  .svg-letter-text,
  .svg-expand-text {
    font-size: 100px !important;
  }
}