/* css/energy.css
   Hearts energy widget + refill dialog
   Mirrors Flutter EnergyWidget / _showRefillDialog
   ─────────────────────────────────────────────── */

/* ══════════════════════════════════════════════
   HEARTS WIDGET  (inside .hn-bar)
══════════════════════════════════════════════ */

/* The clickable pill button */
.hn-hearts {
  display: flex;
  align-items: center;
  background: rgba(239, 68, 68, 0.10);
  border: 1.5px solid rgba(239, 68, 68, 0.25);
  border-radius: 100px;
  padding: 5px 12px;
  cursor: default;           /* overridden to pointer when energy < max */
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  gap: 0;
}

.hn-hearts:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
}

.hn-hearts:active { transform: scale(0.95); }

/* Inner row of hearts + optional timer */
.hn-hearts-inner {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Individual heart SVG */
.hn-heart {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1),
              opacity   0.2s;
}

.hn-heart-full {
  color: #f87171;          /* red-400 */
}

.hn-heart-empty {
  color: rgba(255, 255, 255, 0.18);
}

/* Animate each heart in on load */
.hn-hearts-inner .hn-heart:nth-child(1) { animation: heart-pop 0.3s 0.05s both; }
.hn-hearts-inner .hn-heart:nth-child(2) { animation: heart-pop 0.3s 0.10s both; }
.hn-hearts-inner .hn-heart:nth-child(3) { animation: heart-pop 0.3s 0.15s both; }
.hn-hearts-inner .hn-heart:nth-child(4) { animation: heart-pop 0.3s 0.20s both; }
.hn-hearts-inner .hn-heart:nth-child(5) { animation: heart-pop 0.3s 0.25s both; }

@keyframes heart-pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Countdown timer badge */
.hn-hearts-timer {
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 2px 8px;
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #fca5a5;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* ══════════════════════════════════════════════
   REFILL DIALOG  (bottom sheet style)
══════════════════════════════════════════════ */

.energy-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.energy-dialog-overlay.show { opacity: 1; }

.energy-dialog {
  background: #0d1424;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 12px 24px 36px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.energy-dialog-overlay.show .energy-dialog {
  transform: translateY(0);
}

/* Drag handle */
.energy-dialog-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  margin-bottom: 20px;
}

/* Big heart icon */
.energy-dialog-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.14);
  border: 1.5px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f87171;
  margin-bottom: 16px;
  animation: heart-pulse 1.4s ease-in-out infinite;
}

.energy-dialog-icon svg {
  width: 30px;
  height: 30px;
}

@keyframes heart-pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0   0   rgba(239,68,68,0); }
  50%       { transform: scale(1.07); box-shadow: 0 0 18px 4px rgba(239,68,68,0.25); }
}

/* Title */
.energy-dialog-title {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}

/* Body text */
.energy-dialog-body {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
  margin-bottom: 20px;
  max-width: 300px;
}

/* Countdown pill */
.energy-dialog-countdown {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.2));
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 16px;
  padding: 14px 20px;
  width: 100%;
  margin-bottom: 20px;
  color: #93c5fd;
}

.energy-dialog-countdown svg { flex-shrink: 0; }

.energy-dialog-countdown-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(147, 197, 253, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.energy-dialog-countdown-value {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #93c5fd;
  letter-spacing: -0.5px;
}

/* Hearts row in dialog */
.energy-dialog-hearts {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}

.energy-dialog-hearts svg {
  width: 28px;
  height: 28px;
}

.edh-full  { color: #f87171; }
.edh-empty { color: rgba(255,255,255,0.15); }

/* Action buttons */
.energy-dialog-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.energy-dialog-wait {
  flex: 1;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--muted);
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}

.energy-dialog-wait:hover { background: rgba(255, 255, 255, 0.09); }

.energy-dialog-watch {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  transition: opacity 0.18s, transform 0.15s;
}

.energy-dialog-watch:hover  { opacity: 0.9; transform: translateY(-1px); }
.energy-dialog-watch:active { transform: translateY(0); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .hn-heart         { width: 16px; height: 16px; }
  .hn-hearts        { padding: 4px 9px; }
  .hn-hearts-timer  { font-size: 10px; padding: 2px 6px; }

  .energy-dialog        { padding: 10px 16px 28px; }
  .energy-dialog-title  { font-size: 19px; }
}