@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg:        #07080f;
  --surface:   #0d1520;
  --surface2:  #111d2e;
  --border:    #1a2540;
  --teal:      #00c4b0;
  --teal-dim:  #009f90;
  --teal-glow: rgba(0,196,176,0.18);
  --text:      #e8eaf2;
  --muted:     #5a6a80;
  --ai-color:  #00c4b0;
  --user-color:#e8eaf2;
  --danger:    #e53935;
  --accent:    #4f6ef7;
  --cand-color:#10b981;
  --radius:    14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  overflow: hidden;
}

/* ── SCREENS ───────────────────────────────────────────────────────────────── */
.screen { display: none; height: 100vh; overflow-y: auto; }
.screen.active { display: flex; flex-direction: column; }

/* ── LIVE PILL ─────────────────────────────────────────────────────────────── */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
  width: fit-content;
}
.live-pill.small {
  padding: 4px 12px;
  font-size: 0.75rem;
  margin-bottom: 20px;
}
.live-dot-red {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #e53935;
  box-shadow: 0 0 6px rgba(229,57,53,0.8);
  animation: blink 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
.live-dot-red.small { width: 7px; height: 7px; }
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

/* ── SETUP SCREEN ──────────────────────────────────────────────────────────── */
#setup-screen {
  background: radial-gradient(ellipse at 30% 50%, #0a1a2e 0%, var(--bg) 65%);
  justify-content: center;
  align-items: center;
}
.landing-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: min(1100px, 96vw);
  padding: 40px 20px;
}

/* Landing left */
.landing-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  color: var(--text);
}
.teal { color: var(--teal); }

.landing-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 420px;
}

.cta-talk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 460px;
  padding: 22px 28px;
  background: linear-gradient(135deg, #062b38 0%, #0a1e2e 40%, #071f1c 70%, #00352e 100%);
  border: 1px solid rgba(0,196,176,0.35);
  border-radius: 18px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.1s;
  text-align: left;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(0,196,176,0.08), 0 4px 24px rgba(0,0,0,0.4);
}
.cta-talk::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,196,176,0.07) 0%, transparent 55%);
  pointer-events: none;
}
.cta-talk:hover {
  border-color: rgba(0,196,176,0.7);
  box-shadow: 0 0 36px rgba(0,196,176,0.22), inset 0 1px 0 rgba(0,196,176,0.15), 0 4px 24px rgba(0,0,0,0.4);
}
.cta-talk:active { transform: scale(0.99); }

.cta-talk-title {
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff 0%, #7efff6 60%, #00c4b0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.cta-talk-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--muted);
}
.cta-mic-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,196,176,0.18) 0%, rgba(0,196,176,0.06) 100%);
  border: 1px solid rgba(0,196,176,0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  flex-shrink: 0;
}

/* Landing right */
.landing-right { display: flex; justify-content: center; }

.agent-showcase {
  width: min(320px, 90vw);
  background: #0d1520;
  border: 1px solid rgba(0,196,176,0.18);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,196,176,0.1);
}
.agent-photo-wrap {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
}
/* ── SOUND WAVE DISPLAY ────────────────────────────────────────────────────── */
.sound-wave-display {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 44%, #0d2a40 0%, #07101a 65%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.sound-wave-display.sm {
  width: 210px;
  height: 210px;
  border-radius: 50%;
}

/* Static (no-animation) variant — setup screen only */
.sound-wave-display.static {
  background: radial-gradient(circle at 50% 44%, #0d2a40 0%, #07101a 65%);
}
.sw-core.static {
  width: 84px;
  height: 84px;
  box-shadow: 0 0 40px rgba(0,196,176,0.45), 0 0 80px rgba(0,196,176,0.12);
}

.agent-placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Expanding rings */
.sw-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,196,176,0.55);
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  animation: sw-ripple 2.6s ease-out infinite;
  pointer-events: none;
}
.sw-ring:nth-child(1) { animation-delay: 0s; }
.sw-ring:nth-child(2) { animation-delay: 0.85s; }
.sw-ring:nth-child(3) { animation-delay: 1.7s; }

@keyframes sw-ripple {
  0%   { transform: translate(-50%, -50%) scale(0.9); opacity: 0.75; }
  100% { transform: translate(-50%, -50%) scale(4.8); opacity: 0; }
}

.sound-wave-display.sm .sw-ring {
  width: 46px; height: 46px;
}

/* Center core */
.sw-core {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c4b0, #009a8e);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 28px rgba(0,196,176,0.55), 0 0 64px rgba(0,196,176,0.18);
}
.sound-wave-display.sm .sw-core {
  width: 48px; height: 48px;
}

/* Equalizer bars — pinned to bottom, doesn't affect mic centering */
.sw-bars {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 36px;
  z-index: 2;
}
.sw-bar {
  width: 5px;
  border-radius: 3px;
  background: var(--teal);
  animation: sw-bounce 1.3s ease-in-out infinite;
  transform-origin: bottom;
}
.sw-bar:nth-child(1) { height: 10px; animation-delay: 0.0s; }
.sw-bar:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.sw-bar:nth-child(3) { height: 14px; animation-delay: 0.2s; }
.sw-bar:nth-child(4) { height: 30px; animation-delay: 0.3s; }
.sw-bar:nth-child(5) { height: 14px; animation-delay: 0.4s; }
.sw-bar:nth-child(6) { height: 20px; animation-delay: 0.5s; }
.sw-bar:nth-child(7) { height: 10px; animation-delay: 0.6s; }

@keyframes sw-bounce {
  0%, 100% { transform: scaleY(0.45); opacity: 0.45; }
  50%       { transform: scaleY(1.3);  opacity: 1; }
}

.sound-wave-display.sm .sw-bars { height: 24px; gap: 3px; bottom: 14px; }
.sound-wave-display.sm .sw-bar  { width: 3px; }
.sound-wave-display.sm .sw-bar:nth-child(1),
.sound-wave-display.sm .sw-bar:nth-child(7) { height: 6px; }
.sound-wave-display.sm .sw-bar:nth-child(2),
.sound-wave-display.sm .sw-bar:nth-child(6) { height: 13px; }
.sound-wave-display.sm .sw-bar:nth-child(3),
.sound-wave-display.sm .sw-bar:nth-child(5) { height: 9px; }
.sound-wave-display.sm .sw-bar:nth-child(4) { height: 20px; }
.agent-showcase-footer {
  padding: 20px 24px 24px;
  border-top: 1px solid rgba(0,196,176,0.1);
}
.showcase-say-hi {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 4px;
}
.showcase-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -0.02em;
}

/* ── ACTIVE / CALL SCREEN ──────────────────────────────────────────────────── */
#active-screen {
  display: none;
  flex-direction: row !important;
  background: var(--bg);
}
#active-screen.active { display: flex; }

.call-wrap {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Left agent panel */
.agent-panel {
  width: 340px;
  min-width: 280px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0a1620 0%, #07101a 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 24px;
  overflow: hidden;
}

.call-avatar-wrap {
  position: relative;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  overflow: visible;
  margin-bottom: 20px;
}
.call-avatar-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(0,196,176,0.3);
  transition: all 0.4s;
  pointer-events: none;
  z-index: 1;
}
.ai-speaking .call-avatar-ring {
  border-color: var(--teal);
  box-shadow: 0 0 36px rgba(0,196,176,0.4);
  animation: ring-pulse 1.4s ease-in-out infinite;
}
@keyframes ring-pulse {
  0%,100% { transform:scale(1); opacity:1; }
  50%      { transform:scale(1.06); opacity:0.5; }
}
.robot-svg-sm {
  width: 210px; height: 210px;
  border-radius: 50%;
  display: block;
}

.call-agent-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
}
.call-agent-role {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}


/* Mic-listening indicator in panel */
.call-mic-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s;
}
.call-mic-status.active { opacity: 1; }
.call-mic-status span {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: var(--teal);
  letter-spacing: 0.06em;
}

/* Reuse mic bars */
.mic-bars { display: flex; align-items: flex-end; gap: 4px; height: 24px; }
.mic-bars .bar {
  width: 4px;
  background: var(--teal);
  border-radius: 2px;
  height: 6px;
  animation: bar-bounce 0.8s ease-in-out infinite;
}
.mic-bars .bar:nth-child(1) { animation-delay: 0s; }
.mic-bars .bar:nth-child(2) { animation-delay: 0.12s; }
.mic-bars .bar:nth-child(3) { animation-delay: 0.24s; }
.mic-bars .bar:nth-child(4) { animation-delay: 0.36s; }
.mic-bars .bar:nth-child(5) { animation-delay: 0.48s; }
@keyframes bar-bounce { 0%,100% { height:5px; } 50% { height:20px; } }

/* Right transcript panel */
.transcript-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}
.transcript-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.transcript-header > span:first-child {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.transcript-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,196,176,0.08);
  border: 1px solid rgba(0,196,176,0.2);
  border-radius: 100px;
  padding: 4px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--teal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transcript-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.transcript-list::-webkit-scrollbar { width: 4px; }
.transcript-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.transcript-msg {
  max-width: 72%;
  padding: 12px 16px;
  border-radius: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.6;
  animation: fadein 0.25s ease;
}
@keyframes fadein { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

.transcript-msg.ai {
  background: rgba(0,196,176,0.1);
  border: 1px solid rgba(0,196,176,0.2);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.transcript-msg.candidate {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.transcript-msg.streaming { opacity: 0.88; }
.transcript-msg.streaming .msg-content { font-style: italic; }

.msg-role {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}
.transcript-msg.ai .msg-role        { color: var(--teal); }
.transcript-msg.candidate .msg-role { color: var(--muted); }

/* Call controls bar */
.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.ctrl-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.ctrl-btn:hover { background: rgba(255,255,255,0.1); }
.ctrl-btn.muted {
  background: rgba(229,57,53,0.12);
  border-color: rgba(229,57,53,0.3);
  color: var(--danger);
}

.btn-end-call {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--danger);
  border: none;
  border-radius: 100px;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-end-call:hover   { opacity: 0.88; }
.btn-end-call:active  { transform: scale(0.97); }

.transcript-footer-note {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 8px 0 12px;
  flex-shrink: 0;
}

/* ── HIDDEN COMPAT ELEMENTS ────────────────────────────────────────────────── */
.state-badge { display: none !important; }

/* ── CONFIRMATION SCREEN ───────────────────────────────────────────────────── */
#confirm-screen {
  background: radial-gradient(ellipse at 60% 0%, #1a1f3c 0%, var(--bg) 60%);
  justify-content: center;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 24px;
}
.logo-icon { width: 32px; height: 32px; }

.summary-wrap {
  width: min(520px, 96vw);
  margin: 0 auto;
  padding: 32px 16px;
}
.summary-header { text-align: center; margin-bottom: 28px; }
.summary-header h2 { font-size: 2rem; font-weight: 800; margin: 16px 0 12px; }

.recommendation-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--teal);
  color: var(--teal);
  background: rgba(0,196,176,0.08);
  font-family: 'Inter', sans-serif;
}

.booking-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.booking-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--border);
}
.booking-row:last-child { border-bottom: none; }
.booking-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  min-width: 130px;
  flex-shrink: 0;
}
.booking-value {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text);
}
.booking-value.accent { color: var(--teal); font-weight: 400; letter-spacing: 0.05em; }

.whatsapp-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #25d366;
  font-weight: 500;
  background: rgba(37,211,102,0.07);
  border: 1px solid rgba(37,211,102,0.2);
  border-radius: 8px;
  padding: 10px 16px;
  margin: 16px 0 8px;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dim));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover  { opacity: 0.88; }
.btn-primary:active { transform: scale(0.98); }

/* ── RESPONSIVE ────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .landing-wrap {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 20px;
  }
  .landing-right { order: -1; }
  .agent-showcase { width: 100%; max-width: 320px; margin: 0 auto; }
  .cta-talk { max-width: 100%; }

  .call-wrap { flex-direction: column; }
  .agent-panel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    gap: 10px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-width: unset;
  }
  .call-avatar-wrap { width: 60px; height: 60px; }
  .sound-wave-display.sm { width: 60px; height: 60px; gap: 8px; }
  .sound-wave-display.sm .sw-core { width: 26px; height: 26px; }
  .sound-wave-display.sm .sw-bars { display: none; }
  .call-avatar-ring { inset: -4px; }
  .call-agent-name  { font-size: 1rem; }
  .call-agent-role  { font-size: 0.65rem; display: none; }
  .call-duration-card { padding: 10px 14px; width: auto; }
  .duration-time    { font-size: 1.1rem; }
  .call-mic-status  { display: none; }
  .live-pill        { margin-bottom: 0; }

  .transcript-hint  { display: none; }
  .booking-label    { min-width: 100px; }
}
