/**
 * ceylon-spinner.css
 * Unified Luxury Loading Animation & Theme-Engine Preloader for Ceylon Drive.
 * Designed with Ceylon Emerald, Gold Accents, Frosted Glass, and Orbital Animations.
 */

/* ==========================================================================
   Full-Page Preloader Overlay
   ========================================================================== */
.ceylon-spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 248, 0.96) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
  pointer-events: all;
}

.ceylon-spinner-overlay.fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ==========================================================================
   Luxury Loader Container Box
   ========================================================================== */
.ceylon-luxury-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 20px 40px -15px rgba(27, 77, 62, 0.1), 0 0 1px 1px rgba(255, 255, 255, 0.8) inset;
  max-width: 320px;
  width: 90%;
  animation: ceylon-box-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   Dual-Ring Orbital Spinner & Center Crest
   ========================================================================== */
.ceylon-spinner-orbit {
  position: relative;
  width: 78px;
  height: 78px;
  margin-bottom: 20px;
}

.orbit-ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(27, 77, 62, 0.12);
  border-top: 3px solid var(--primary-color, #1B4D3E);
  border-right: 3px solid #D4AF37;
  animation: ceylon-spin 1.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  box-shadow: 0 0 16px rgba(27, 77, 62, 0.15);
}

.orbit-ring-inner {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px dashed rgba(212, 175, 55, 0.45);
  border-bottom: 2px solid var(--secondary-color, #2D6A4F);
  animation: ceylon-spin-reverse 1.8s linear infinite;
}

.orbit-center-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(27, 77, 62, 0.06);
  animation: ceylon-pulse 2s ease-in-out infinite;
}

.orbit-center-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ==========================================================================
   Brand Typography & Tagline
   ========================================================================== */
.ceylon-brand-title {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 3.5px;
  color: var(--primary-color, #1B4D3E);
  text-transform: uppercase;
  margin-bottom: 3px;
  background: linear-gradient(135deg, #1B4D3E 0%, #2D6A4F 60%, #D4AF37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ceylon-brand-tagline {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #64748B;
  margin-bottom: 16px;
}

/* ==========================================================================
   Shimmer Progress Indicator
   ========================================================================== */
.ceylon-progress-bar {
  width: 130px;
  height: 3px;
  background: rgba(27, 77, 62, 0.1);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.ceylon-progress-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, transparent 0%, #1B4D3E 50%, #D4AF37 80%, transparent 100%);
  border-radius: 6px;
  animation: ceylon-shimmer 1.4s ease-in-out infinite;
}

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */
@keyframes ceylon-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes ceylon-spin-reverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes ceylon-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.9;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.12);
    opacity: 1;
  }
}

@keyframes ceylon-shimmer {
  0% { left: -50%; }
  100% { left: 120%; }
}

@keyframes ceylon-box-enter {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ==========================================================================
   Unified In-Page Action / Submission Loading Overlay
   (Compatible with drop-pickup-booking, memories, guide_vehicles)
   ========================================================================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.3s ease;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loading-spinner:empty {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(27, 77, 62, 0.15);
  border-top-color: var(--primary-color, #1B4D3E);
  border-right-color: #D4AF37;
  animation: ceylon-spin 0.9s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 20px rgba(27, 77, 62, 0.15);
}

.loading-spinner .spinner-border {
  width: 3.5rem;
  height: 3.5rem;
  border-width: 3px;
  border-color: rgba(27, 77, 62, 0.15);
  border-top-color: var(--primary-color, #1B4D3E) !important;
  border-right-color: #D4AF37 !important;
  animation: ceylon-spin 0.9s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

