/* ============================================================
   TheBookFlight — Booking Progress Animation System
   Engaging distraction UI while backend processes booking
   ============================================================ */

/* ── Animated Progress Container ── */
.bp-progress-zone {
  display: none; /* shown via JS when isPending */
  margin: 0 auto 32px;
  max-width: 700px;
}
.bp-progress-zone.active { display: block; }

/* ── Flying Plane Animation ── */
.bp-plane-track {
  position: relative;
  height: 80px;
  margin: 0 0 24px;
  overflow: hidden;
}
.bp-plane-track::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(208,2,27,0.4), rgba(208,2,27,0.8), rgba(208,2,27,0.4), transparent);
  transform: translateY(-50%);
}
/* Dots along the track */
.bp-plane-track::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px, transparent 15px,
    rgba(255,255,255,0.15) 15px, rgba(255,255,255,0.15) 18px
  );
  transform: translateY(-50%);
}

.bp-plane-icon {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  color: var(--primary);
  filter: drop-shadow(0 0 12px rgba(208,2,27,0.6));
  animation: flyPlane 4s ease-in-out infinite;
  z-index: 2;
}
@keyframes flyPlane {
  0%   { left: 10%; opacity: 0.4; }
  10%  { opacity: 1; }
  50%  { left: 50%; transform: translate(-50%, -55%); }
  90%  { opacity: 1; }
  100% { left: 90%; opacity: 0.4; }
}

.bp-plane-trail {
  position: absolute;
  top: 50%;
  left: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary));
  animation: trailGrow 4s ease-in-out infinite;
  z-index: 1;
  transform: translateY(-50%);
}
@keyframes trailGrow {
  0%   { width: 0%; opacity: 0; }
  50%  { width: 40%; opacity: 0.6; }
  100% { width: 80%; opacity: 0; }
}

.bp-plane-clouds {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
.bp-cloud {
  position: absolute;
  font-size: 16px;
  color: rgba(255,255,255,0.06);
  animation: cloudDrift 8s linear infinite;
}
.bp-cloud:nth-child(1) { top: 10%; animation-delay: 0s; }
.bp-cloud:nth-child(2) { top: 65%; animation-delay: 3s; font-size: 12px; }
.bp-cloud:nth-child(3) { top: 30%; animation-delay: 5s; font-size: 20px; }
@keyframes cloudDrift {
  0%   { left: -10%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 110%; opacity: 0; }
}

/* ── Step Progress Bar ── */
.bp-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 32px;
  position: relative;
  padding: 0 8px;
}
.bp-steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 40px;
  right: 40px;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
}
.bp-steps-fill {
  position: absolute;
  top: 20px;
  left: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #ff4d6d);
  border-radius: 2px;
  transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(208,2,27,0.4);
}

.bp-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  position: relative;
}
.bp-step__dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: rgba(255,255,255,0.3);
  transition: all 0.5s ease;
}
.bp-step.active .bp-step__dot {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 20px rgba(208,2,27,0.3);
  animation: stepPulse 2s infinite;
}
.bp-step.done .bp-step__dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
  box-shadow: 0 0 16px rgba(16,185,129,0.3);
}
@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(208,2,27,0.3); }
  50%      { box-shadow: 0 0 30px rgba(208,2,27,0.5); }
}

.bp-step__label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.bp-step.active .bp-step__label,
.bp-step.done .bp-step__label { color: rgba(255,255,255,0.7); }

/* ── Tips Carousel ── */
.bp-tips {
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 160px;
}
.bp-tips::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(208,2,27,0.03), transparent 60%);
  animation: shimmerBg 8s linear infinite;
}
@keyframes shimmerBg {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.bp-tip {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: tipFadeIn 0.6s ease;
  position: relative;
  z-index: 1;
}
.bp-tip.active { display: flex; }

@keyframes tipFadeIn {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.bp-tip__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.bp-tip__icon.blue { background: rgba(59,130,246,0.12); color: #3b82f6; }
.bp-tip__icon.amber { background: rgba(245,158,11,0.12); color: #f59e0b; }
.bp-tip__icon.green { background: rgba(16,185,129,0.12); color: #10b981; }
.bp-tip__icon.purple { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.bp-tip__icon.pink { background: rgba(236,72,153,0.12); color: #ec4899; }
.bp-tip__icon.cyan { background: rgba(6,182,212,0.12); color: #06b6d4; }

.bp-tip__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}
.bp-tip__text {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
  max-width: 500px;
}
.bp-tip__category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.3);
}

/* ── Tip Progress Dots ── */
.bp-tip-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.bp-tip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}
.bp-tip-dot.active {
  width: 20px;
  border-radius: 3px;
  background: var(--primary);
}

/* ── Fun Facts Counter ── */
.bp-funfact {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding: 14px 20px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.12);
  border-radius: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}
.bp-funfact__icon {
  font-size: 20px;
  flex-shrink: 0;
  animation: funFactPop 0.5s ease;
}
@keyframes funFactPop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ── Elapsed Timer ── */
.bp-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
  margin-top: 16px;
  font-variant-numeric: tabular-nums;
}
.bp-timer i {
  font-size: 14px;
  color: var(--primary);
  animation: spin 2s linear infinite;
}

/* ── Confetti Burst (on confirmed) ── */
.bp-confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .bp-steps { gap: 0; padding: 0; }
  .bp-step__dot { width: 32px; height: 32px; font-size: 13px; }
  .bp-step__label { font-size: 9px; }
  .bp-tips { padding: 20px 16px; min-height: 140px; }
  .bp-tip__title { font-size: 14px; }
  .bp-tip__text { font-size: 12px; }
  .bp-plane-track { height: 60px; }
  .bp-plane-icon { font-size: 22px; }
}
