/* ============================================================
   THE PATH TO WATER — Barakah Stack Ripple Demo
   Concentric ripple animation with right-side legend
   ============================================================ */

.barakah-demo-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin: 2rem 0;
}

.barakah-demo {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
}

.barakah-demo .demo-subtitle {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.barakah-demo .demo-trigger {
  display: inline-block;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.5rem 1.4rem;
  border-radius: 50px;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all 0.25s;
}
.barakah-demo .demo-trigger:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Ripple Layout: circles left, legend right ── */
.ripple-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  margin: 0 auto;
}

/* ── Concentric Rings ── */
.ripple-canvas {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

.ripple-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.ripple-canvas.animate .ripple-ring {
  animation: rippleExpand 0.6s ease forwards;
}

.ripple-ring:nth-child(1) { width: 28px; height: 28px; }
.ripple-ring:nth-child(2) { width: 56px; height: 56px; }
.ripple-ring:nth-child(3) { width: 88px; height: 88px; }
.ripple-ring:nth-child(4) { width: 120px; height: 120px; }
.ripple-ring:nth-child(5) { width: 156px; height: 156px; }
.ripple-ring:nth-child(6) { width: 192px; height: 192px; }

.ripple-canvas.animate .ripple-ring:nth-child(1) { animation-delay: 0s; }
.ripple-canvas.animate .ripple-ring:nth-child(2) { animation-delay: 0.12s; }
.ripple-canvas.animate .ripple-ring:nth-child(3) { animation-delay: 0.24s; }
.ripple-canvas.animate .ripple-ring:nth-child(4) { animation-delay: 0.36s; }
.ripple-canvas.animate .ripple-ring:nth-child(5) { animation-delay: 0.48s; }
.ripple-canvas.animate .ripple-ring:nth-child(6) { animation-delay: 0.6s; }

/* Center dot — always visible as the starting point */
.ripple-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  z-index: 2;
}

/* Hide the center label entirely — the legend handles it */
.ripple-center-label {
  display: none;
}

/* Each ring gets progressively darker and thicker — compounding */
.ripple-ring:nth-child(1) { border-width: 1px; }
.ripple-ring:nth-child(2) { border-width: 1.2px; }
.ripple-ring:nth-child(3) { border-width: 1.5px; }
.ripple-ring:nth-child(4) { border-width: 2px; }
.ripple-ring:nth-child(5) { border-width: 2.5px; }
.ripple-ring:nth-child(6) { border-width: 3px; }

.ripple-canvas.animate .ripple-ring:nth-child(1) { animation-name: rippleExpand1; }
.ripple-canvas.animate .ripple-ring:nth-child(2) { animation-name: rippleExpand2; }
.ripple-canvas.animate .ripple-ring:nth-child(3) { animation-name: rippleExpand3; }
.ripple-canvas.animate .ripple-ring:nth-child(4) { animation-name: rippleExpand4; }
.ripple-canvas.animate .ripple-ring:nth-child(5) { animation-name: rippleExpand5; }
.ripple-canvas.animate .ripple-ring:nth-child(6) { animation-name: rippleExpand6; }

@keyframes rippleExpand1 {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  40% { opacity: 0.2; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.2; }
}
@keyframes rippleExpand2 {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  40% { opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
}
@keyframes rippleExpand3 {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  40% { opacity: 0.4; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
}
@keyframes rippleExpand4 {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  40% { opacity: 0.52; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.52; }
}
@keyframes rippleExpand5 {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  40% { opacity: 0.65; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.65; }
}
@keyframes rippleExpand6 {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  40% { opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
}

/* ── Legend (right side) ── */
.ripple-legend {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: flex-start;
}

.ripple-legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ripple-layout.animate .ripple-legend-item {
  opacity: 1;
  transform: translateX(0);
}

.ripple-layout.animate .ripple-legend-item:nth-child(1) { transition-delay: 0.02s; }
.ripple-layout.animate .ripple-legend-item:nth-child(2) { transition-delay: 0.12s; }
.ripple-layout.animate .ripple-legend-item:nth-child(3) { transition-delay: 0.24s; }
.ripple-layout.animate .ripple-legend-item:nth-child(4) { transition-delay: 0.36s; }
.ripple-layout.animate .ripple-legend-item:nth-child(5) { transition-delay: 0.48s; }
.ripple-layout.animate .ripple-legend-item:nth-child(6) { transition-delay: 0.6s; }
.ripple-layout.animate .ripple-legend-item:nth-child(7) { transition-delay: 0.72s; }

.ripple-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Dots get progressively darker — compounding builds momentum */
.ripple-legend-item:nth-child(1) .ripple-legend-dot { opacity: 1; }
.ripple-legend-item:nth-child(2) .ripple-legend-dot { opacity: 0.25; }
.ripple-legend-item:nth-child(3) .ripple-legend-dot { opacity: 0.35; }
.ripple-legend-item:nth-child(4) .ripple-legend-dot { opacity: 0.45; }
.ripple-legend-item:nth-child(5) .ripple-legend-dot { opacity: 0.57; }
.ripple-legend-item:nth-child(6) .ripple-legend-dot { opacity: 0.7; }
.ripple-legend-item:nth-child(7) .ripple-legend-dot { opacity: 0.85; }

.ripple-legend-text {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

/* First item (Niyyah) gets bolder treatment */
.ripple-legend-item:first-child .ripple-legend-text {
  font-weight: 600;
  color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 500px) {
  .ripple-layout {
    flex-direction: column;
    gap: 1.5rem;
  }
  .ripple-canvas {
    width: 180px;
    height: 180px;
  }
  .ripple-legend {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1rem;
  }
}
