/* Initial Page Load State */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:wght@400;500;600&display=swap');

body.loading {
  overflow: hidden;
}

body.loading > *:not(#kr-overlay) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Loading Screen Styles */
.kr-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://images.unsplash.com/photo-1561361058-c22354d45669?auto=format&fit=crop&q=80');
  background-size: cover;
  background-position: center;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 1;
  transition: all 1.2s ease-in-out;
  overflow: hidden;
}

/* Rich Background Layers */
.kr-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    215deg,
    rgba(13, 13, 20, 0.95) 0%,
    rgba(66, 44, 29, 0.85) 50%,
    rgba(13, 13, 20, 0.95) 100%
  );
  opacity: 1;
}

.kr-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0.8) 100%
  );
  mix-blend-mode: multiply;
}

/* Animated Background Elements */
.kr-bg-elements {
  position: absolute;
  inset: -50px;
  opacity: 0.4;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 216, 145, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 216, 145, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 216, 145, 0.05) 0%, transparent 100%);
  filter: blur(40px);
  animation: bg-pulse 8s ease-in-out infinite;
}

.kr-sacred-symbol {
  position: absolute;
  width: 280px;
  height: 280px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: url('../images/trisul.png') center/contain no-repeat;
  opacity: 0;
  z-index: 1;
  filter:
    brightness(1.2)
    drop-shadow(0 0 20px rgba(248, 227, 176, 0.3));
  animation: trishul-glow 4s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

@keyframes trishul-glow {
  0%, 100% {
    opacity: 0.08;
    transform: translate(-50%, -50%) scale(1);
    filter:
      brightness(1.2)
      drop-shadow(0 0 20px rgba(248, 227, 176, 0.3));
  }
  50% {
    opacity: 0.15;
    transform: translate(-50%, -50%) scale(1.02);
    filter:
      brightness(1.3)
      drop-shadow(0 0 30px rgba(248, 227, 176, 0.4));
  }
}

@keyframes bg-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.5;
  }
}

@keyframes symbol-rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.kr-overlay.fade-out {
  opacity: 0;
}

/* Stage 1: Welcome */
.kr-stage1 {
  position: relative;
  font-family: 'Cinzel', serif;
  font-size: 3.5rem;
  color: #f9e9c6;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.9s ease-out;
  text-shadow: 0 0 15px rgba(249, 233, 198, 0.3);
  animation: titleGlow 1.8s ease-in-out infinite;
  text-align: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.kr-stage1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(249, 233, 198, 0) 0%,
    rgba(249, 233, 198, 0.8) 50%,
    rgba(249, 233, 198, 0) 100%
  );
  box-shadow:
    0 0 10px rgba(249, 233, 198, 0.4),
    0 0 20px rgba(249, 233, 198, 0.2);
  animation: drawUnderline 1.2s ease-out forwards 0.3s;
}

@keyframes titleGlow {
  0%, 100% {
    text-shadow:
      0 0 15px rgba(249, 233, 198, 0.3),
      0 0 30px rgba(249, 233, 198, 0.1);
  }
  50% {
    text-shadow:
      0 0 20px rgba(249, 233, 198, 0.4),
      0 0 40px rgba(249, 233, 198, 0.15);
  }
}

@keyframes drawUnderline {
  0% {
    width: 0;
    opacity: 0;
  }
  100% {
    width: 100%;
    opacity: 1;
  }
}

.kr-stage1.show {
  opacity: 1;
  transform: translateY(0);
}

/* Stage 2: Tagline */
.kr-stage2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  color: #e2e8f0;
  margin-top: 1rem;
  opacity: 0;
  text-align: center;
  width: 100%;
  max-width: 600px;
  margin: 1rem auto 0;
  transform: translateY(15px);
  transition: all 0.8s ease-out;
}

.kr-stage2.show {
  opacity: 1;
  transform: translateY(0);
}

/* Loading Messages */
.kr-message-container {
  width: 100%;
  max-width: 600px;
  margin: 0.5rem auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

.kr-message {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.4s ease;
  margin-top: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Advanced Loading Bar Container */
.kr-loading-container {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 300px;
}

.kr-loader-percentage {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: rgba(255, 216, 145, 0.9);
  text-shadow: 0 0 10px rgba(255, 216, 145, 0.4);
  transition: all 0.3s ease;
}

/* Advanced Loading Bar */
.kr-loader {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 2rem;
  box-shadow:
    0 0 25px rgba(248, 227, 176, 0.15),
    inset 0 0 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(248, 227, 176, 0.2);
}

.kr-loader::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(248, 227, 176, 0.2),
    transparent
  );
  animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(200%);
  }
}

/* Ornamental designs */
.kr-loader::before,
.kr-loader::after {
  content: '॥';
  position: absolute;
  top: 50%;
  transform: translateY(-55%);
  font-size: 1.5rem;
  color: rgba(255, 216, 145, 0.8);
  text-shadow: 0 0 10px rgba(255, 216, 145, 0.4);
  font-family: 'Noto Sans Devanagari', sans-serif;
  z-index: 1;
}

.kr-loader::before {
  left: -25px;
}

.kr-loader::after {
  right: -25px;
}

.kr-loader-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg,
    #f8e3b0 0%,
    #d4b06a 51%,
    #f8e3b0 100%);
  box-shadow:
    0 0 15px rgba(248, 227, 176, 0.4),
    0 0 8px rgba(248, 227, 176, 0.3),
    inset 0 0 6px rgba(255, 255, 255, 0.3);
  animation: loader-pulse 2.4s ease-in-out infinite;
  will-change: width, filter;
  transform: translateZ(0);
  transition: width 5s cubic-bezier(0.4, 0, 0.2, 1);
}@keyframes loader-pulse {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(255, 216, 145, 0.5),
      0 0 10px rgba(255, 216, 145, 0.5),
      inset 0 0 8px rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow:
      0 0 25px rgba(255, 216, 145, 0.6),
      0 0 15px rgba(255, 216, 145, 0.6),
      inset 0 0 12px rgba(255, 255, 255, 0.4);
  }
}/* Loading Bar Decorative Elements */
.kr-loader-decorative {
  position: absolute;
  top: 50%;
  width: 100%;
  height: 20px;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.5;
}

.kr-loader-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 216, 145, 0.5);
  top: 50%;
  transform: translateY(-50%);
}

.kr-loader-dot:nth-child(1) { left: -2px; }
.kr-loader-dot:nth-child(2) { right: -2px; }

.kr-loader-text {
  position: absolute;
  top: -30px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 1rem;
  color: rgba(255, 216, 145, 0.9);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  letter-spacing: 1px;
  opacity: 0;
  transform: translateY(5px);
  animation: loader-text-fade 2s ease-out forwards;
  text-shadow: 0 0 20px rgba(255, 216, 145, 0.3);
}

.kr-loader-percentage {
  position: absolute;
  bottom: -35px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: rgba(255, 216, 145, 1);
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(255, 216, 145, 0.4);
}

/* Loading Bar Animations */
@keyframes loader-shine {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  20% {
    opacity: 0.5;
  }
  80% {
    opacity: 0.5;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes loader-text-fade {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Particle System */
.kr-embers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}

.kr-ember {
  position: absolute;
  width: var(--size, 4px);
  height: var(--size, 4px);
  background: #ffd891;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0;
  animation:
    float var(--duration, 5000ms) ease-in-out forwards,
    glow var(--glow-duration, 2000ms) ease-in-out infinite;
  box-shadow: 0 0 var(--glow-size, 10px) var(--glow-color, rgba(255, 216, 145, 0.3));
}

/* Advanced Light Orbs */
.kr-light-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    rgba(255, 216, 145, 0.15),
    rgba(255, 216, 145, 0.05) 40%,
    transparent 70%
  );
  filter: blur(20px);
  mix-blend-mode: screen;
  animation: orb-float var(--duration, 12s) ease-in-out infinite;
}

.kr-light-orb:nth-child(1) {
  width: 300px;
  height: 300px;
  top: 20%;
  left: 15%;
  --duration: 18s;
}

.kr-light-orb:nth-child(2) {
  width: 400px;
  height: 400px;
  bottom: 25%;
  right: 20%;
  --duration: 15s;
  animation-delay: -7s;
}

.kr-light-orb:nth-child(3) {
  width: 250px;
  height: 250px;
  top: 40%;
  right: 35%;
  --duration: 20s;
  animation-delay: -3s;
}

@keyframes float {
  0% {
    opacity: 0;
    transform: translateY(0) scale(1) rotate(0deg);
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(0.5) rotate(180deg);
  }
}

@keyframes glow {
  0%, 100% {
    filter: blur(1px);
    box-shadow: 0 0 var(--glow-size) var(--glow-color);
  }
  50% {
    filter: blur(2px);
    box-shadow: 0 0 calc(var(--glow-size) * 1.5) var(--glow-color);
  }
}

@keyframes orb-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: var(--base-opacity, 0.15);
  }
  25% {
    transform: translate(-20px, -20px) scale(1.1);
    opacity: calc(var(--base-opacity, 0.15) * 1.2);
  }
  75% {
    transform: translate(20px, 20px) scale(0.9);
    opacity: calc(var(--base-opacity, 0.15) * 0.8);
  }
}

/* Homepage Reveal Animations */
.hero-title {
  opacity: 0;
  transform: translateY(30px);
}

.hero-title.reveal {
  animation: slideUp 0.8s ease forwards;
}

.hero-sub {
  opacity: 0;
  transform: translateY(20px);
}

.hero-sub.reveal {
  animation: slideUp 0.8s ease forwards 0.1s;
}

.btn-explore {
  animation: fadeIn 0.6s ease forwards 0.6s;
}

.btn-book {
  animation: fadeIn 0.6s ease forwards 0.8s;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .reduce-motion .kr-ember {
    display: none;
  }

  .reduce-motion .kr-stage1,
  .reduce-motion .kr-stage2,
  .reduce-motion .kr-message {
    transition: opacity 0.3s ease;
  }

  .reduce-motion .kr-loader-fill {
    transition: width 1.5s linear;
  }
}
