/* Shared UI components */

/* ===== NAVIGATION ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(243, 235, 247, 0.62);
  border-bottom: 1px solid rgba(75, 42, 99, 0.08);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-num-lg);
  letter-spacing: -0.02em;
  color: var(--charcoal);
  text-decoration: none;
}
.logo-img {
  height: 32px;
  width: auto;
  display: block;
}
.logo-mark {
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--accent);
  border-radius: 50%;
  transform: scale(0.6);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
.nav-links { display: flex; gap: 34px; }
.nav-links a {
  font-size: var(--fs-body-base);
  color: var(--charcoal-75);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color var(--duration-base) var(--ease-smooth);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--primary);
  transition: width var(--duration-slow) var(--ease-smooth);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }
.nav-ctas { display: flex; gap: 10px; align-items: center; }

/* ===== BUTTONS ===== */
.btn-ghost {
  font-size: var(--fs-body-base);
  color: var(--on-surface);
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 500;
  transition: color var(--duration-base) var(--ease-smooth);
}
.btn-ghost:hover { color: var(--primary); }

.btn-primary {
  font-size: var(--fs-body-base);
  background: var(--primary);
  color: var(--white);
  border: none;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--duration-base) var(--ease-smooth);
  position: relative;
  overflow: hidden;
  z-index: 0;
  box-shadow: 0 4px 12px rgba(75, 42, 99, 0.22);
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--primary-dark);
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-smooth);
  z-index: -1;
}
.btn-primary:hover::after { transform: translateY(0); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(75, 42, 99, 0.3); }
.btn-primary .arrow { transition: transform var(--duration-base) var(--ease-smooth); }
.btn-primary:hover .arrow { transform: translate(2px, -2px); }

.btn-primary-lg {
  background: var(--primary);
  color: var(--white);
  border: none;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--duration-base) var(--ease-smooth);
  position: relative;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 8px 20px rgba(75, 42, 99, 0.25);
}
.btn-primary-lg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--primary-dark);
  transform: translateY(101%);
  transition: transform var(--duration-slow) var(--ease-smooth);
  z-index: -1;
}
.btn-primary-lg:hover::after { transform: translateY(0); }
.btn-primary-lg:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(75, 42, 99, 0.32);
}
.btn-primary-lg .arrow { transition: transform var(--duration-base) var(--ease-smooth); }
.btn-primary-lg:hover .arrow { transform: translate(3px, -3px); }

.btn-secondary-lg {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(75, 42, 99, 0.22);
  font-family: inherit;
  cursor: pointer;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--duration-base) var(--ease-smooth);
}
.btn-secondary-lg:hover { border-color: var(--primary); background: rgba(75, 42, 99, 0.04); }

/* ===== DEMO PLAYER ===== */
.demo-player {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 246, 253, 0.96) 100%);
  border: 1px solid rgba(75, 42, 99, 0.08);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 12px 40px rgba(75, 42, 99, 0.12);
}
.demo-player.dark {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.07) 100%);
  backdrop-filter: blur(28px) saturate(220%);
  -webkit-backdrop-filter: blur(28px) saturate(220%);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.35),
    inset 0 1.5px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.18);
}

/* ===== CALL META ===== */
.call-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: var(--fs-label-lg);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(75, 42, 99, 0.6);
  font-weight: 600;
}
.call-meta.dark { color: rgba(199, 166, 222, 0.75); }
.call-meta .live-mark { display: inline-flex; align-items: center; gap: 7px; }
.call-meta .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(155, 207, 106, 0.6);
  animation: pulse-lime 2s infinite;
}
.call-flag {
  font-size: var(--fs-label-sm);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(75, 42, 99, 0.08);
  color: var(--primary);
  letter-spacing: 0.04em;
}
.call-flag.dark { background: rgba(199, 166, 222, 0.15); color: var(--primary-pale); }

/* ===== TRANSCRIPT ===== */
.transcript {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 130px;
}
.transcript-bubble {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: var(--radius-lg);
  font-size: var(--fs-body-base);
  line-height: 1.45;
}
.transcript-bubble.agent {
  background: rgba(132, 76, 172, 0.08);
  color: var(--charcoal);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.transcript-bubble.customer {
  background: var(--white);
  color: var(--primary);
  border: 1px solid rgba(75, 42, 99, 0.12);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.transcript-bubble.agent.dark { background: rgba(199, 166, 222, 0.18); color: rgba(255, 255, 255, 0.95); }
.transcript-bubble.customer.dark { background: rgba(255, 255, 255, 0.92); color: var(--primary); }
.transcript-bubble .label {
  font-size: var(--fs-label-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}
.transcript-bubble.agent .label { color: var(--primary); }
.transcript-bubble.customer .label { color: rgba(75, 42, 99, 0.6); }
.transcript-bubble.agent.dark .label { color: var(--primary-pale); }
.transcript-bubble.customer.dark .label { color: rgba(75, 42, 99, 0.55); }

/* ===== PLAYER CONTROLS ===== */
.player-controls {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(75, 42, 99, 0.08);
  display: flex;
  align-items: center;
  gap: 14px;
}
.player-controls.dark { border-color: rgba(255, 255, 255, 0.1); }

.play-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--cream);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-base) var(--ease-smooth);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(75, 42, 99, 0.25);
}
.play-btn:hover { box-shadow: 0 6px 18px rgba(75, 42, 99, 0.35); transform: scale(1.05); }
.play-btn.playing { background: var(--primary-dark); }
.play-btn.dark { background: var(--primary-pale); color: var(--primary-dark); box-shadow: 0 4px 12px rgba(199, 166, 222, 0.3); }
.play-btn.dark.playing { background: var(--white); }

.waveform {
  flex: 1;
  height: 40px;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
/* played-region overlay + cursor needle — driven by --wsp set in AudioPlayer */
.waveform::before,
.mini-waveform::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: var(--wsp, 0%);
  background: rgba(75, 42, 99, 0.15);
  border-right: 2px solid rgba(75, 42, 99, 0.65);
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
}
.waveform.dark::before {
  background: rgba(199, 166, 222, 0.15);
  border-right-color: rgba(199, 166, 222, 0.8);
}

.time-display {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-md);
  color: rgba(75, 42, 99, 0.55);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.time-display.dark { color: rgba(199, 166, 222, 0.7); }

/* ===== MINI CONTROLS ===== */
.mini-play {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-base) var(--ease-smooth);
}
.mini-play:hover { transform: scale(1.05); }

.mini-waveform { height: 32px; flex: 1; overflow: hidden; position: relative; cursor: pointer; }

@media (max-width: 960px) {
  .nav-inner { padding: 12px 20px; }
  .nav-links { display: none; }
  .nav-ctas { display: none; }
}
