/* ══════════════════════════════════════════════
   Codural Guided Tour — Spotlight Overlay
   ══════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────────── */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.tour-overlay.tour-fade-in {
  animation: tourFadeIn 0.3s ease forwards;
}

.tour-overlay.tour-fade-out {
  animation: tourFadeOut 0.25s ease forwards;
}

/* ── Spotlight (highlighted element) ─────────── */
.tour-spotlight {
  position: relative;
  z-index: 99999 !important;
  pointer-events: auto !important;
  border-radius: inherit;
  transition: box-shadow 0.4s ease;
}

/* ── Tooltip ─────────────────────────────────── */
.tour-tooltip {
  position: fixed;
  z-index: 100000;
  width: min(400px, calc(100vw - 32px));
  background: rgba(11, 51, 39, 0.95);
  border: 1px solid rgba(32, 194, 155, 0.3);
  border-radius: 20px;
  padding: 20px;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 30px rgba(32, 194, 155, 0.08);
  font-family: "Cairo", "Inter", system-ui, sans-serif;
  color: #e5eaf7;
  direction: rtl;
  text-align: right;
  pointer-events: auto;
}

[dir="ltr"] .tour-tooltip,
.tour-tooltip.tour-ltr {
  direction: ltr;
  text-align: left;
}

.tour-tooltip.tour-animate-in {
  animation: tourSlideIn 0.35s ease forwards;
}

/* ── Tooltip top accent line ─────────────────── */
.tour-tooltip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #20c29b, transparent);
  border-radius: 16px 16px 0 0;
}

/* ── Step Counter ────────────────────────────── */
.tour-step-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #20c29b;
  margin-bottom: 12px;
  opacity: 0.85;
}

.tour-step-counter .tour-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(32, 194, 155, 0.3);
  display: inline-block;
}

.tour-step-counter .tour-step-dot.active {
  background: #20c29b;
  width: 18px;
  border-radius: 3px;
}

/* ── Title ───────────────────────────────────── */
.tour-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ecfff9;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* ── Text ────────────────────────────────────── */
.tour-text {
  font-size: 0.95rem;
  color: #90e6d6;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ── Buttons Row ─────────────────────────────── */
.tour-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tour-btn-next {
  flex: 1;
  min-width: 140px;
  padding: 12px 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #20c29b, #17d4a7);
  color: #022119;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: 0 4px 18px rgba(32, 194, 155, 0.35);
  position: relative;
  overflow: hidden;
}

.tour-btn-next::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.tour-btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(32, 194, 155, 0.45);
}

.tour-btn-next:hover::before {
  left: 100%;
}

.tour-btn-close {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(144, 230, 214, 0.6);
  font-weight: 500;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.tour-btn-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ecfff9;
}

/* ── Completion Screen ───────────────────────── */
.tour-completion {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 24px;
  animation: tourFadeIn 0.4s ease forwards;
}

.tour-completion-card {
  width: min(440px, calc(100vw - 48px));
  background: #0b3327;
  border: 1px solid rgba(32, 194, 155, 0.35);
  border-radius: 24px;
  padding: 48px 32px 36px;
  text-align: center;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(32, 194, 155, 0.1);
  animation: tourScaleIn 0.5s ease forwards;
  position: relative;
  overflow: hidden;
}

.tour-completion-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #20c29b, #17d4a7, #20c29b);
}

.tour-completion-emoji {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: tourBounce 0.6s ease 0.3s both;
}

.tour-completion-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ecfff9;
  margin-bottom: 8px;
}

.tour-completion-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: #20c29b;
  margin-bottom: 16px;
}

.tour-completion-text {
  font-size: 0.95rem;
  color: #90e6d6;
  line-height: 1.7;
  margin-bottom: 28px;
}

.tour-completion-btn {
  display: inline-block;
  padding: 14px 36px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #20c29b, #17d4a7);
  color: #022119;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(32, 194, 155, 0.35);
}

.tour-completion-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(32, 194, 155, 0.5);
}

/* ── Animations ──────────────────────────────── */
@keyframes tourFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes tourSlideIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tourScaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tourBounce {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes tourShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .tour-tooltip {
    position: fixed !important;
    bottom: 16px !important;
    top: auto !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-height: 55vh;
    overflow-y: auto;
    border-radius: 18px;
  }

  .tour-tooltip.tour-animate-in {
    animation: tourSlideUp 0.35s ease forwards;
  }

  .tour-title {
    font-size: 1.05rem;
  }

  .tour-text {
    font-size: 0.9rem;
  }

  .tour-completion-card {
    padding: 36px 20px 28px;
  }

  .tour-completion-emoji {
    font-size: 2.8rem;
  }

  .tour-completion-title {
    font-size: 1.3rem;
  }
}

@keyframes tourSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
