/**
 * Agape Light Network — Cinematic Success Micro-Interaction (Dopamine Trigger)
 * Neuroscience-backed emotional validation & celebratory reward architecture.
 */

.dopamine-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at center, rgba(15, 35, 71, 0.94) 0%, rgba(6, 11, 24, 0.98) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.dopamine-overlay.active {
  opacity: 1;
  visibility: visible;
}

.dopamine-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.dopamine-card {
  position: relative;
  z-index: 2;
  max-width: 580px;
  width: 100%;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(7, 13, 24, 0.98));
  border: 2px solid rgba(212, 175, 55, 0.65);
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.25), 0 25px 60px rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  padding: 3rem 2.5rem 2.5rem 2.5rem;
  text-align: center;
  color: #ffffff;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  overflow: hidden;
}

.dopamine-overlay.active .dopamine-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Radiant Gold Aura behind badge */
.dopamine-aura {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.35) 0%, rgba(184, 51, 42, 0.15) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(25px);
  pointer-events: none;
  animation: auraPulse 3s ease-in-out infinite alternate;
}

@keyframes auraPulse {
  0% { transform: translateX(-50%) scale(0.9); opacity: 0.6; }
  100% { transform: translateX(-50%) scale(1.15); opacity: 0.95; }
}

/* Animated SVG Checkmark */
.dopamine-check-wrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 1.5rem auto;
  position: relative;
}

.dopamine-check-svg {
  width: 96px;
  height: 96px;
  display: block;
}

.dopamine-circle {
  stroke: #d4af37;
  stroke-width: 3.5;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  stroke-linecap: round;
  fill: rgba(212, 175, 55, 0.1);
  transition: stroke-dashoffset 0.8s cubic-bezier(0.65, 0, 0.45, 1);
}

.dopamine-check {
  stroke: #10b981;
  stroke-width: 4.5;
  stroke-dasharray: 70;
  stroke-dashoffset: 70;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.65, 0, 0.45, 1) 0.5s;
}

.dopamine-overlay.active .dopamine-circle {
  stroke-dashoffset: 0;
}

.dopamine-overlay.active .dopamine-check {
  stroke-dashoffset: 0;
}

/* Close icon */
.dopamine-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.dopamine-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: rotate(90deg);
}

/* Titles & Badges */
.dopamine-badge {
  display: inline-block;
  background: rgba(212, 175, 55, 0.2);
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.45);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.dopamine-title {
  font-family: var(--font-heading, 'Cinzel', serif);
  font-size: clamp(1.6rem, 3.5vw, 2.15rem);
  color: #ffffff;
  line-height: 1.25;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.dopamine-subtitle {
  font-size: 1.1rem;
  color: #38bdf8;
  font-weight: 600;
  margin: 0 0 1.25rem 0;
}

.dopamine-scripture {
  font-style: italic;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--color-gold, #c2902c);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin: 0 auto 1.5rem auto;
  max-width: 500px;
  text-align: left;
}

/* Reference Dossier Card */
.dopamine-dossier {
  background: rgba(11, 19, 37, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  text-align: left;
}

.dopamine-dossier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.875rem;
}

.dopamine-dossier-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dopamine-ref-tag {
  font-family: 'Consolas', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.05em;
}

/* Buttons */
.dopamine-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.dopamine-btn-primary {
  background: linear-gradient(135deg, #b8332a 0%, #991b1b 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(184, 51, 42, 0.4);
  transition: all 0.25s ease;
  cursor: pointer;
}

.dopamine-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(184, 51, 42, 0.55);
  color: #ffffff;
}

.dopamine-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  cursor: pointer;
}

.dopamine-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

@media (max-width: 640px) {
  .dopamine-card {
    padding: 2rem 1.25rem 1.5rem 1.25rem;
  }
  .dopamine-title {
    font-size: 1.45rem;
  }
  .dopamine-subtitle {
    font-size: 0.95rem;
  }
  .dopamine-actions {
    flex-direction: column;
  }
  .dopamine-btn-primary, .dopamine-btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

