/* ══════════════════════════════════════════════════════
   TWILIO CALL UI — Mondo Senza Tempo — TEMA CHIARO
   Overlay chiamata, timer, credito residuo
   ══════════════════════════════════════════════════════ */

/* ── Overlay fullscreen ──────────────────────────────── */
#callOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#callOverlay.hidden { display: none; }

/* ── Modal centrale — sfondo bianco ─────────────────── */
.call-modal {
  background: #ffffff;
  border: 1px solid rgba(201,168,76,0.30);
  border-radius: 24px;
  padding: 2.5rem 2rem 2rem;
  width: min(420px, 92vw);
  text-align: center;
  color: #222;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 0 30px rgba(201,168,76,0.08);
  animation: callModalIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}

/* Striscetta decorativa oro in cima */
.call-modal::before {
  content: '';
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #c9a84c, #e8ca7a, #c9a84c);
  border-radius: 24px 24px 0 0;
}

@keyframes callModalIn {
  from { opacity: 0; transform: scale(0.88) translateY(24px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ── Avatar ──────────────────────────────────────────── */
.call-avatar {
  font-size: 3.2rem;
  margin-bottom: 0.75rem;
  display: block;
}
.call-avatar--pulse {
  animation: avatarPulse 2s ease-in-out infinite;
}
@keyframes avatarPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(201,168,76,0.4)); }
  50%       { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(201,168,76,0.7)); }
}

/* ── Nome operatore ──────────────────────────────────── */
.call-nome {
  font-size: 1.45rem;
  font-weight: 700;
  color: #a07a30;
  margin: 0 0 0.4rem;
  font-family: 'Cinzel', serif;
}

/* ── Testi status ────────────────────────────────────── */
.call-status-text {
  font-size: 1rem;
  color: #333;
  margin: 0 0 0.2rem;
  font-weight: 500;
}
.call-info {
  font-size: 0.84rem;
  color: #888;
  margin: 0 0 1.4rem;
}

/* ── Spinner oro ─────────────────────────────────────── */
.call-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(201,168,76,0.18);
  border-top-color: #c9a84c;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 1.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tariffa ─────────────────────────────────────────── */
.call-tariffa {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 1.4rem;
  letter-spacing: 0.04em;
}

/* ── Timer ───────────────────────────────────────────── */
.call-timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.75rem 0 0.6rem;
}
.call-timer-label {
  font-size: 0.72rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.15rem;
}
.call-timer {
  font-size: 2.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #222;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.05em;
}

/* ── Progress bar credito ────────────────────────────── */
.call-progress-wrap {
  margin: 0.5rem 0 1.1rem;
}
.call-progress-track {
  background: #f0f0f0;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.call-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: #22c55e;
  transition: width 1s linear, background 0.3s;
  width: 0%;
}

/* ── Credito residuo box ─────────────────────────────── */
.call-credito-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #fffbf0, #fdf6e3);
  border: 1.5px solid rgba(201,168,76,0.40);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
}
.call-credito-label {
  font-size: 0.85rem;
  color: #6b5a30;
  font-weight: 500;
}
.call-credito {
  font-size: 1.2rem;
  font-weight: 700;
  color: #a07a30;
  font-family: 'Cinzel', serif;
  transition: color 0.3s;
}
.call-credito.text-red-500 { color: #dc2626 !important; }

/* ── Riepilogo finale ────────────────────────────────── */
.call-riepilogo {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem;
  margin: 1.1rem 0;
}
.call-riga {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.92rem;
  color: #555;
}
.call-riga:last-child { border-bottom: none; }
.call-riga strong { color: #a07a30; font-weight: 700; }
.call-info-fine {
  font-size: 0.78rem;
  color: #aaa;
  margin-bottom: 1.4rem;
}

/* ── Pulsante Annulla / Chiudi consulto ──────────────── */
.btn-hungup {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(220,38,38,0.35);
  letter-spacing: 0.02em;
}
.btn-hungup:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220,38,38,0.45);
}
.btn-hungup:active { transform: translateY(0); }

/* ── Pulsante Chiudi riepilogo ───────────────────────── */
.btn-close-riepilogo {
  background: linear-gradient(135deg, #c9a84c, #a07a30);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(201,168,76,0.35);
}
.btn-close-riepilogo:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.45);
}

/* ── Pulsante "Chiama ora" nelle card cartomante ─────── */
.btn-chiama-ora {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(22,163,74,0.30);
  text-decoration: none;
}
.btn-chiama-ora:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(22,163,74,0.45);
}
.btn-chiama-ora:disabled {
  background: #d1d5db;
  color: #9ca3af;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn-chiama-ora .call-price {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* ── Responsive mobile ───────────────────────────────── */
@media (max-width: 480px) {
  .call-modal {
    padding: 2rem 1.25rem 1.75rem;
    border-radius: 20px 20px 0 0;
  }
  #callOverlay {
    align-items: flex-end;
    padding: 0;
  }
  .call-modal { width: 100%; border-radius: 24px 24px 0 0; }
  .call-nome  { font-size: 1.25rem; }
  .call-timer { font-size: 2.4rem; }
  .btn-hungup,
  .btn-close-riepilogo { font-size: 0.9rem; padding: 0.8rem 1.5rem; }
}
