/* =============================================
   CHA THAI - ANIMATIONS CSS
   Intro Screen + Micro-animations
   ============================================= */

/* =============================================
   INTRO / LOADING SCREEN
   ============================================= */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0f0a03;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.intro-screen.fade-out {
  animation: intro-fade-out 0.8s ease forwards;
}

@keyframes intro-fade-out {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); pointer-events: none; }
}

/* Intro Background Pattern */
.intro-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image:
    repeating-linear-gradient(45deg, var(--gold-400) 0, var(--gold-400) 1px, transparent 0, transparent 50%),
    repeating-linear-gradient(-45deg, var(--gold-400) 0, var(--gold-400) 1px, transparent 0, transparent 50%);
  background-size: 40px 40px;
  animation: pattern-drift 20s linear infinite;
}

@keyframes pattern-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(40px, 40px); }
}

/* Glow Orb */
.intro-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orb-pulse 3s ease-in-out infinite alternate;
}

.intro-orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(200, 150, 12, 0.25);
  top: -100px;
  left: -100px;
}

.intro-orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(180, 100, 0, 0.2);
  bottom: -100px;
  right: -100px;
  animation-delay: 1.5s;
}

@keyframes orb-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* Intro Logo */
.intro-logo-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.intro-logo {
  width: 160px;
  height: 160px;
  opacity: 0;
  transform: scale(0.5) translateY(20px);
  animation: logo-appear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
  filter: drop-shadow(0 0 30px rgba(200, 150, 12, 0.5));
}

@keyframes logo-appear {
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.intro-title {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  color: transparent;
  background: linear-gradient(135deg, #f9d97a, #c8960c, #f5c03a, #8B6914);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  opacity: 0;
  letter-spacing: 0.05em;
  animation:
    title-reveal 0.7s ease 0.8s forwards,
    shimmer-text 3s linear 1.5s infinite;
}

@keyframes title-reveal {
  from { opacity: 0; transform: translateY(12px); letter-spacing: 0.2em; }
  to { opacity: 1; transform: translateY(0); letter-spacing: 0.05em; }
}

@keyframes shimmer-text {
  0% { background-position: 0% center; }
  100% { background-position: 300% center; }
}

.intro-tagline {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0;
  animation: fade-up 0.6s ease 1.2s forwards;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Progress bar */
.intro-progress-wrap {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  z-index: 10;
}

.intro-progress-bar {
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.intro-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  width: 0%;
  border-radius: 2px;
  animation: progress-fill 1.8s ease 0.5s forwards;
}

@keyframes progress-fill {
  to { width: 100%; }
}

.intro-progress-text {
  text-align: center;
  margin-top: 12px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
}

/* Floating decorative symbols */
.intro-deco {
  position: absolute;
  color: var(--gold-500);
  opacity: 0;
  font-size: 1.5rem;
  animation: deco-float 0.6s ease forwards;
}

.intro-deco-1 { top: 25%; left: 20%; animation-delay: 1s; }
.intro-deco-2 { top: 35%; right: 22%; animation-delay: 1.2s; }
.intro-deco-3 { bottom: 30%; left: 25%; animation-delay: 1.4s; }
.intro-deco-4 { bottom: 25%; right: 20%; animation-delay: 1.6s; }

@keyframes deco-float {
  to { opacity: 0.3; transform: translateY(-10px); }
}

/* =============================================
   HERO ANIMATIONS
   ============================================= */
.hero-content .hero-label {
  animation: fade-up 0.7s ease 0.1s both;
}

.hero-content .hero-title {
  animation: fade-up 0.8s ease 0.25s both;
}

.hero-content .hero-desc {
  animation: fade-up 0.7s ease 0.4s both;
}

.hero-content .hero-actions {
  animation: fade-up 0.7s ease 0.55s both;
}

.hero-stats {
  animation: fade-up 0.7s ease 0.7s both;
}

/* Hero scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 100px;
  right: var(--space-xl);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fade-up 1s ease 1s both;
}

.scroll-indicator-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  writing-mode: vertical-rl;
}

.scroll-indicator-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: scroll-line 2s ease-in-out infinite;
}

@keyframes scroll-line {
  0%, 100% { opacity: 1; transform: scaleY(1); transform-origin: top; }
  50% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
}

/* =============================================
   CARD HOVER EFFECTS
   ============================================= */
.card-glow {
  position: relative;
  overflow: hidden;
}

.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--gold-400), transparent, var(--gold-500));
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
}

.card-glow:hover::before { opacity: 1; }

/* =============================================
   PULSE BADGE (bestseller indicator)
   ============================================= */
.pulse-badge {
  position: relative;
}

.pulse-badge::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: rgba(231, 76, 60, 0.3);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* =============================================
   NUMBER COUNTER ANIMATION
   ============================================= */
.counter-number {
  display: inline-block;
  transition: all 0.1s;
}

/* =============================================
   PARALLAX
   ============================================= */
.parallax-element {
  will-change: transform;
}

/* =============================================
   STAGGER ANIMATION (for card grids)
   ============================================= */
.stagger-child {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-child.visible {
  animation: stagger-in 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes stagger-in {
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   TYPEWRITER EFFECT
   ============================================= */
.typewriter {
  border-right: 2px solid var(--gold-400);
  animation: blink-cursor 0.7s step-end infinite;
  white-space: nowrap;
  overflow: hidden;
}

@keyframes blink-cursor {
  0%, 100% { border-right-color: var(--gold-400); }
  50% { border-right-color: transparent; }
}

/* =============================================
   FLOATING CTA BUTTON
   ============================================= */
.floating-book-btn {
  position: fixed;
  bottom: calc(var(--space-xl) + 60px);
  right: var(--space-xl);
  z-index: 400;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-base);
  animation: float-btn 3s ease-in-out infinite;
}

.floating-book-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(231, 76, 60, 0.5);
}

@keyframes float-btn {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* =============================================
   SECTION BACKGROUND DECORATIONS
   ============================================= */
.deco-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.06;
  background: var(--gold-400);
}

.deco-circle-lg {
  width: 500px;
  height: 500px;
}

.deco-circle-md {
  width: 300px;
  height: 300px;
}

/* =============================================
   THAI PATTERN BORDER
   ============================================= */
.thai-border {
  border-image: repeating-linear-gradient(
    90deg,
    var(--gold-500) 0px,
    var(--gold-500) 4px,
    transparent 4px,
    transparent 12px,
    var(--gold-400) 12px,
    var(--gold-400) 16px,
    transparent 16px,
    transparent 24px
  ) 4;
}

.thai-border-top {
  border-top: 4px solid;
  border-image: repeating-linear-gradient(
    90deg,
    var(--gold-500) 0px,
    var(--gold-500) 4px,
    transparent 4px,
    transparent 12px
  ) 4;
}

/* =============================================
   WAVE DIVIDER
   ============================================= */
.wave-divider {
  overflow: hidden;
  line-height: 0;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}

/* =============================================
   SPARKLE ANIMATION (on star ratings)
   ============================================= */
@keyframes sparkle {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.2); filter: brightness(1.5); }
}

.star-sparkle:hover .stars { animation: sparkle 0.4s ease; }

/* =============================================
   PAGE TRANSITIONS
   ============================================= */
.page-enter {
  animation: page-in 0.5s ease forwards;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   IMAGE LOADING SKELETON
   ============================================= */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 0%, var(--border-color) 50%, var(--bg-secondary) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s linear infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =============================================
   RIPPLE EFFECT (on buttons)
   ============================================= */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: ripple-anim 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* =============================================
   HOVER GLOW (card images)
   ============================================= */
.img-glow {
  transition: filter 0.3s ease;
}

.menu-card:hover .img-glow {
  filter: brightness(1.05) saturate(1.1);
}
