/* =============================================================================
   ASTRA GAMIFICATION SYSTEM — astra-gamification.css
   digitalastra.it | dark #0a0f1a | teal #00d4aa | pink #D92D58 | gold #ffd700
   Fonts: Syne (display) | Inter (body)
   ============================================================================= */

/* =============================================================================
   1. SCROLL PROGRESS BAR
   ============================================================================= */

.astra-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #00d4aa, #D92D58);
  z-index: 999;
  pointer-events: none;
  transition: width 0.1s linear;
}

/* =============================================================================
   2. TIMELINE — PROCESS STEPS
   ============================================================================= */

/* Site uses .step inside .process-steps, not .process-step */
.process-steps .step.locked {
  opacity: 0.3;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.process-steps .step.unlocked {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* =============================================================================
   3. CONFETTI CANVAS
   ============================================================================= */

.astra-confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
}

/* =============================================================================
   4. JOURNEY BADGE
   ============================================================================= */

.astra-journey-badge {
  position: fixed;
  bottom: 80px;
  left: 24px;
  display: none;
  align-items: center;
  gap: 8px;
  background: #0a0f1a;
  border: 1px solid #00d4aa;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #e8f0fe;
  z-index: 998;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 212, 170, 0.15);
}

.astra-journey-badge.visible {
  display: flex;
}

.astra-journey-badge.gold {
  border-color: #ffd700;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.2);
}

.astra-journey-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 170, 0.25);
}

.astra-journey-badge.gold:hover {
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

/* =============================================================================
   5. JOURNEY EXPANDED PANEL
   ============================================================================= */

.astra-journey-expanded {
  position: fixed;
  bottom: 80px;
  left: 24px;
  width: 220px;
  background: #0a0f1a;
  border: 1px solid #00d4aa;
  border-radius: 12px;
  padding: 16px;
  z-index: 998;
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0, 212, 170, 0.15);
}

.astra-journey-expanded.visible {
  display: flex;
}

.astra-journey-expanded .panel-header {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #00d4aa;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.astra-journey-expanded .page-item {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.astra-journey-expanded .page-item.visited {
  color: #00d4aa;
}

.astra-journey-expanded .page-item.visited::before {
  content: '✓';
  font-size: 11px;
  color: #00d4aa;
}

.astra-journey-expanded .page-item:not(.visited)::before {
  content: '○';
  font-size: 11px;
  color: #888;
}

/* =============================================================================
   6. ROI CALCULATOR
   ============================================================================= */

.astra-roi-section {
  background: #0d1520;
  border-radius: 16px;
  padding: 32px;
  max-width: 600px;
  margin: 0 auto;
  border: 1px solid rgba(0, 212, 170, 0.15);
}

.astra-roi-section h3 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  color: #e8f0fe;
  margin-bottom: 24px;
}

.astra-roi-label {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #888;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.astra-roi-label span {
  color: #e8f0fe;
  font-weight: 500;
}

.astra-roi-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #1a2a3a;
  border-radius: 2px;
  outline: none;
  margin-bottom: 20px;
  cursor: pointer;
}

.astra-roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00d4aa;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 212, 170, 0.5);
  transition: box-shadow 0.2s ease;
}

.astra-roi-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 14px rgba(0, 212, 170, 0.7);
}

.astra-roi-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00d4aa;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(0, 212, 170, 0.5);
}

.astra-roi-result {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #00d4aa;
  margin-top: 8px;
}

.astra-roi-result-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

/* =============================================================================
   7. ACHIEVEMENT TOAST
   ============================================================================= */

.astra-achievement-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: #0a0f1a;
  border: 1px solid #ffd700;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10001;
  pointer-events: none;
  box-shadow: 0 4px 24px rgba(255, 215, 0, 0.2);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.astra-achievement-toast.show {
  transform: translateX(-50%) translateY(0);
}

.astra-achievement-toast .toast-icon {
  font-size: 20px;
}

.astra-achievement-toast .toast-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #e8f0fe;
}

.astra-achievement-toast .toast-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #ffd700;
  display: block;
}

/* =============================================================================
   8. CHAT UI
   ============================================================================= */

.astra-chat-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.astra-chat-bubble {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.astra-chat-bubble.user {
  flex-direction: row-reverse;
}

.astra-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D92D58, #ff6b8a);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  font-family: 'Syne', sans-serif;
}

.astra-chat-avatar.bot {
  background: linear-gradient(135deg, #00d4aa, #0097a7);
}

.astra-chat-text {
  max-width: 75%;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #e8f0fe;
  animation: chatSlideUp 0.3s ease forwards;
}

.astra-chat-bubble:not(.user) .astra-chat-text {
  background: #1a2a3a;
  border-radius: 4px 16px 16px 16px;
}

.astra-chat-bubble.user .astra-chat-text {
  background: rgba(0, 212, 170, 0.12);
  border: 1px solid rgba(0, 212, 170, 0.25);
  border-radius: 16px 4px 16px 16px;
  text-align: right;
}

.astra-chat-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 46px;
}

.astra-chat-option {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  background: #0d1520;
  border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #e8f0fe;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  text-align: left;
}

.astra-chat-option:hover {
  transform: translateX(4px);
  border-color: #00d4aa;
  background: rgba(0, 212, 170, 0.08);
}

.astra-typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.astra-typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: #1a2a3a;
  border-radius: 4px 16px 16px 16px;
}

.astra-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #888;
  animation: typingPulse 1.2s ease-in-out infinite;
}

.astra-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.astra-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* =============================================================================
   9. SCORE DISPLAY
   ============================================================================= */

.astra-score-display {
  text-align: center;
  padding: 24px 0;
}

.astra-score-number {
  font-family: 'Syne', sans-serif;
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #00d4aa, #D92D58);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.astra-score-label {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #888;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.astra-quick-wins {
  background: #1a2a3a;
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}

.astra-quick-wins h4 {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.astra-quick-win-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.astra-quick-win-item:last-child {
  border-bottom: none;
}

.astra-quick-win-item .win-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #e8f0fe;
}

.astra-quick-win-item .win-value {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #00d4aa;
}

/* =============================================================================
   10. EMAIL GATE
   ============================================================================= */

.astra-email-gate {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}

.astra-email-input {
  width: 100%;
  padding: 14px 16px;
  background: #0d1520;
  border: 1px solid #1a2a3a;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #e8f0fe;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.astra-email-input::placeholder {
  color: #888;
}

.astra-email-input:focus {
  border-color: #00d4aa;
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.astra-email-submit {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #D92D58, #ff6b8a);
  border: none;
  border-radius: 8px;
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(217, 45, 88, 0.3);
}

.astra-email-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 45, 88, 0.45);
}

.astra-email-submit:active {
  transform: translateY(0);
}

.astra-email-disclaimer {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #888;
  text-align: center;
  line-height: 1.5;
}

/* =============================================================================
   11. ANIMATIONS
   ============================================================================= */

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

@keyframes typingPulse {
  0%, 100% {
    transform: scale(0.8);
    opacity: 0.3;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes badgePop {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@keyframes progressGlow {
  0%, 100% {
    box-shadow: 0 0 6px rgba(0, 212, 170, 0.4);
  }
  50% {
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.8);
  }
}

/* =============================================================================
   12. RESPONSIVE — 768px
   ============================================================================= */

@media (max-width: 768px) {
  .astra-chat-container {
    padding: 16px;
  }

  .astra-chat-text {
    max-width: 85%;
  }

  .astra-score-number {
    font-size: 42px;
  }

  .astra-roi-section {
    padding: 20px 16px;
  }

  .astra-journey-badge {
    bottom: 70px;
    left: 16px;
  }

  .astra-journey-expanded {
    bottom: 70px;
    left: 16px;
  }

  .astra-chat-options {
    margin-left: 36px;
  }

  .astra-achievement-toast {
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
  }
}

/* =============================================================================
   13. RESPONSIVE — 480px
   ============================================================================= */

@media (max-width: 480px) {
  .astra-chat-text {
    max-width: 90%;
    font-size: 13px;
  }

  .astra-score-number {
    font-size: 36px;
  }

  .astra-roi-section {
    padding: 16px 12px;
  }

  .astra-roi-result {
    font-size: 24px;
  }

  .astra-journey-badge {
    font-size: 12px;
    padding: 6px 12px;
  }

  .astra-journey-expanded {
    width: calc(100vw - 32px);
  }

  .astra-email-submit {
    font-size: 14px;
    padding: 12px 16px;
  }

  .astra-chat-options {
    margin-left: 0;
  }
}
