/* ============================================================
   ESIMM — Animations & Micro-interactions
   ============================================================ */

/* Floating particles (canvas-based — see main.js) */
#heroParticles { position: absolute; inset: 0; pointer-events: none; z-index: 0; }

/* ============================================================
   Page transition
   ============================================================ */
.page-enter {
  animation: pageEnter 0.4s ease both;
}
@keyframes pageEnter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   Loading spinner
   ============================================================ */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(201,168,76,0.2);
  border-top-color: var(--color-accent, #22C55E);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner--lg { width: 40px; height: 40px; border-width: 3px; }
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Shimmer / Skeleton
   ============================================================ */
.shimmer {
  position: relative;
  overflow: hidden;
  background: #F1F5F9;
}
.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.65) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ============================================================
   Hover glow ring (plan cards, CTA buttons)
   ============================================================ */
.glow-ring {
  position: relative;
}
.glow-ring::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--color-accent, #22C55E), transparent, var(--color-accent, #22C55E));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.glow-ring:hover::before { opacity: 1; }

/* ============================================================
   Ripple effect on buttons
   ============================================================ */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.5s linear;
  background: rgba(255,255,255,0.15);
  pointer-events: none;
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ============================================================
   Scroll-triggered animations (used with IntersectionObserver)
   ============================================================ */
[data-animate="fade-up"] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate="fade-up"].animated {
  opacity: 1;
  transform: translateY(0);
}

[data-animate="fade-left"] {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate="fade-left"].animated { opacity: 1; transform: translateX(0); }

[data-animate="fade-right"] {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate="fade-right"].animated { opacity: 1; transform: translateX(0); }

[data-animate="zoom-in"] {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-animate="zoom-in"].animated { opacity: 1; transform: scale(1); }

/* Delay helpers */
[data-delay="100"] { transition-delay: 0.1s !important; }
[data-delay="200"] { transition-delay: 0.2s !important; }
[data-delay="300"] { transition-delay: 0.3s !important; }
[data-delay="400"] { transition-delay: 0.4s !important; }
[data-delay="500"] { transition-delay: 0.5s !important; }

/* ============================================================
   Typing cursor effect
   ============================================================ */
.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--color-accent, #22C55E);
  font-weight: 100;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================================
   Number counter animation (JS-driven)
   ============================================================ */
.count-up {
  display: inline-block;
  transition: all 0.05s ease;
}

/* ============================================================
   Gradient text animation
   ============================================================ */
.gradient-text-animate {
  background: linear-gradient(
    270deg,
    #22C55E, #E8C97A, #22C55E, #9A7E2E
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   Modal slide-in
   ============================================================ */
@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-enter { animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* ============================================================
   Toast notifications
   ============================================================ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--color-surface, #F8FAFC);
  border: 1px solid var(--color-border, rgba(201,168,76,0.3));
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--color-text, #0F172A);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  pointer-events: all;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.toast.removing { animation: toastOut 0.2s ease both; }
.toast-success { border-color: rgba(16,185,129,0.3); }
.toast-error   { border-color: rgba(239,68,68,0.3); }
.toast-icon-success { color: #10B981; }
.toast-icon-error   { color: #EF4444; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ============================================================
   Logo shimmer
   ============================================================ */
.logo-shimmer {
  position: relative;
  overflow: hidden;
}
.logo-shimmer::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: skewX(-20deg);
  animation: logoShimmer 3s ease 1s infinite;
}
@keyframes logoShimmer {
  0%   { left: -60%; }
  100% { left: 120%; }
}

/* ============================================================
   Micro-interactions
   ============================================================ */

/* Navbar link hover — underline slide */
.navbar__nav a {
  position: relative;
}
.navbar__nav a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%; right: 50%;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transition: left 0.25s ease, right 0.25s ease;
}
.navbar__nav a:hover::after,
.navbar__nav a.active::after {
  left: 8px; right: 8px;
}

/* Plan row — hover state price highlight */
.plan-row:hover .plan-row__price-value {
  transform: scale(1.05);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

/* Plan row — hover CTA arrow slide */
.plan-row .btn svg {
  transition: transform 0.2s ease;
}
.plan-row:hover .btn svg {
  transform: translateX(3px);
}

/* Dest-card hover — flag scale */
.dest-card:hover .dest-card__flag img {
  transform: scale(1.12);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.dest-card .dest-card__flag img {
  transition: transform 0.2s ease;
}

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

/* Sort button — active bounce */
.sort-btn.active {
  animation: sortBtnPop 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes sortBtnPop {
  from { transform: scale(0.92); }
  to   { transform: scale(1); }
}

/* Plan group header reveal */
.plan-group__header {
  animation: slideFromLeft 0.5s cubic-bezier(0.22,0.97,0.58,1) both;
}
@keyframes slideFromLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Stat card number pulse on count-up */
.hero__stat-value.counting {
  animation: numPop 0.08s ease both;
}
@keyframes numPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Hero badge entrance */
.hero__badge {
  transition: box-shadow 0.25s ease;
}
.hero__badge:hover {
  box-shadow: 0 0 0 4px rgba(34,197,94,0.12);
}

/* Scroll arrow bounce for hero CTA */
.btn-primary.btn-lg svg {
  animation: arrowBounce 2s ease 2s infinite;
}
@keyframes arrowBounce {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(2px); }
}

/* Delay helpers extended */
[data-delay="50"]  { transition-delay: 0.05s !important; }
[data-delay="150"] { transition-delay: 0.15s !important; }
[data-delay="250"] { transition-delay: 0.25s !important; }
[data-delay="350"] { transition-delay: 0.35s !important; }
[data-delay="450"] { transition-delay: 0.45s !important; }
[data-delay="480"] { transition-delay: 0.48s !important; }
