/* ==========================================================================
   Hotel Sampoorna — Animation Enhancement Layer
   Loads AFTER style.css. Purely additive: does not edit or override any
   existing rule, only adds new visual/motion polish on top of the
   existing design system (same color variables, same class names).
   ========================================================================== */

/* ---------- Page load fade-in ---------- */
body { opacity: 0; }
body.spr-loaded {
  opacity: 1;
  transition: opacity 0.6s ease;
}

/* ---------- Professional opening / preloader (home page) ---------- */
.spr-preloader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--background, #fbf4ec), var(--surface-alt, #fdf0e4));
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.spr-preloader-inner { text-align: center; }
.spr-preloader-ring {
  position: relative;
  width: 350px;
  height: 350px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spr-preloader-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(232, 98, 43, 0.14);
  border-top-color: var(--primary, #e8622b);
  border-right-color: var(--accent, #f2a742);
  animation: spr-pl-spin 1.1s linear infinite;
}
.spr-preloader-ring::after {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 2px dashed rgba(232, 98, 43, 0.18);
  animation: spr-pl-spin-rev 3.2s linear infinite;
}
.spr-preloader-logo {
  width: 300px;
  height: auto;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: scale(0.82);
  animation:
    spr-pl-logo 0.9s cubic-bezier(.22,.9,.3,1) forwards,
    spr-pl-pulse 1.8s ease-in-out 1.4s infinite;
  filter: drop-shadow(0 10px 22px rgba(232, 98, 43, 0.25));
}
.spr-preloader-tag {
  margin-top: 4px;
  font-family: var(--font-body);
  opacity: 0;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft, #55483d);
  animation: spr-pl-tag 0.7s 1s ease forwards;
}
@keyframes spr-pl-logo { to { opacity: 1; transform: scale(1); } }
@keyframes spr-pl-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes spr-pl-tag { to { opacity: 1; } }
@keyframes spr-pl-spin { to { transform: rotate(360deg); } }
@keyframes spr-pl-spin-rev { to { transform: rotate(-360deg); } }
.spr-preloader.spr-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
body.spr-loading { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .spr-preloader-logo, .spr-preloader-tag {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .spr-preloader-ring::before, .spr-preloader-ring::after {
    animation: none !important;
  }
}
@media (max-width: 480px) {
  .spr-preloader-ring { width: 150px; height: 150px; }
  .spr-preloader-logo { width: 100px; }
}

/* ---------- Accent text shimmer (hero headline) ---------- */
.hero-copy h1 .accent {
  background: linear-gradient(100deg, var(--primary, #e8622b) 0%, var(--accent, #f2a742) 30%, var(--primary, #e8622b) 60%, var(--accent, #f2a742) 90%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: spr-shimmer 6s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hero-copy h1 .accent { animation: none; -webkit-text-fill-color: currentColor; background: none; }
}
@keyframes spr-shimmer {
  to { background-position: -250% center; }
}

/* ---------- Split-word heading reveal (page-hero h1) ---------- */
.spr-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em);
  filter: blur(4px);
  animation: spr-word-in 0.7s cubic-bezier(.22,.9,.3,1) forwards;
}
@keyframes spr-word-in {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ---------- Animated counters ---------- */
.spr-counting { font-variant-numeric: tabular-nums; }

/* ---------- Card tilt (desktop, pointer:fine only) ---------- */
@media (hover: hover) and (pointer: fine) {
  .amenity-card, .room-card, .nearby-card, .review-card, .gallery-item, .tour-item, .stat-box {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.25s cubic-bezier(.22,.9,.3,1), box-shadow 0.35s ease, border-color 0.35s ease;
  }
}

/* ---------- Button shine sweep ---------- */
.btn { position: relative; overflow: hidden; }
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
}
.btn-primary:hover::before { left: 130%; }

/* ---------- Button ripple ---------- */
.spr-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  transform: scale(0);
  animation: spr-ripple 0.6s ease-out forwards;
  pointer-events: none;
}
.btn-outline .spr-ripple, .btn-ghost .spr-ripple {
  background: rgba(232, 98, 43, 0.25);
}
@keyframes spr-ripple {
  to { transform: scale(2.6); opacity: 0; }
}

/* ---------- Hero image parallax ---------- */
.hero-media .frame img { will-change: transform; }

/* ---------- Image zoom-in reveal ---------- */
.reveal .frame img,
.reveal-left .frame img,
.reveal-right .frame img {
  transform: scale(1.12);
  transition: transform 1.1s cubic-bezier(.22,.9,.3,1);
}
.reveal.active .frame img,
.reveal-left.active .frame img,
.reveal-right.active .frame img {
  transform: scale(1);
}

/* ---------- Star rating pop-in ---------- */
.spr-star {
  display: inline-block;
  opacity: 0;
  transform: scale(0.2) rotate(-25deg);
  animation: spr-star-in 0.45s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes spr-star-in {
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ---------- Closing banner ring pulse ---------- */
.closing-banner .ring {
  position: relative;
}
.closing-banner .ring::after {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--primary, #e8622b);
  opacity: 0.5;
  animation: spr-pulse-ring 2.4s ease-out infinite;
}
@keyframes spr-pulse-ring {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ---------- Nav underline glow ---------- */
.main-nav a::after {
  box-shadow: 0 0 8px rgba(232, 98, 43, 0.55);
}

/* ---------- Back to top ---------- */
.back-to-top { transition: transform 0.3s cubic-bezier(.22,.9,.3,1), box-shadow 0.3s ease, opacity 0.3s ease, background-color 0.3s ease !important; }
.back-to-top:hover { transform: translateY(-4px) rotate(-6deg); }

/* ---------- Floating quick-action buttons ---------- */
.spr-fab-stack {
  position: fixed;
  right: 18px;
  bottom: 86px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 800;
}
@media (min-width: 769px) {
  .spr-fab-stack { bottom: 26px; }
}
.spr-fab {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
  position: relative;
  transition: transform 0.3s cubic-bezier(.22,.9,.3,1), box-shadow 0.3s ease;
  animation: spr-fab-in 0.5s cubic-bezier(.22,.9,.3,1) backwards;
}
.spr-fab:hover { transform: translateY(-4px) scale(1.06); box-shadow: 0 16px 30px rgba(0,0,0,0.28); }
.spr-fab:active { transform: scale(0.94); }
.spr-fab svg { width: 25px; height: 25px; }
.spr-fab.spr-fab-call { background: var(--primary, #e8622b); animation-delay: 0.1s; }
.spr-fab.spr-fab-whatsapp { background: #25d366; animation-delay: 0.22s; }
.spr-fab::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.5;
  animation: spr-pulse-ring 2.2s ease-out infinite;
}
.spr-fab-call::before { color: var(--primary, #e8622b); }
.spr-fab-whatsapp::before { color: #25d366; animation-delay: 1.1s; }
@keyframes spr-fab-in {
  from { opacity: 0; transform: translateX(30px) scale(0.6); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ---------- Mobile tap feedback ---------- */
@media (max-width: 768px) {
  .amenity-card:active, .room-card:active, .nearby-card:active,
  .review-card:active, .gallery-item:active, .tour-item:active,
  .stat-box:active, .btn:active {
    transform: scale(0.97);
  }
}

/* ---------- Lightbox crossfade ---------- */
.lightbox img {
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(.22,.9,.3,1);
}

/* ---------- Reduced motion: neutralize everything above ---------- */
@media (prefers-reduced-motion: reduce) {
  .spr-word, .spr-star, .spr-fab { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  .closing-banner .ring::after, .spr-fab::before { animation: none !important; }
  body { opacity: 1 !important; }
  .spr-preloader { transition: none; }
}
