/* HMC Voice Agent — Custom styles (supplements Tailwind CDN) */

:root {
  /* HMC blue, sampled from the logo; the lighter logo blue is too pale for text on white */
  --accent: #0079c2;
  --accent-soft: #e8f3fb;
  --accent-border: #a9d4f0;
  --brand-navy: #00467a;
  --emergency: #b91c1c;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
/* The logo is white on HMC's blue gradient, so the header carries the same gradient. */
.brand-header {
  background: linear-gradient(90deg, #006fc2 0%, #3691d0 55%, #77cdf0 100%);
}

.emergency-note {
  color: var(--emergency);
}

/* ── Background glow ─────────────────────────────────────────────────────── */
.bg-glow {
  position: fixed;
  bottom: -10%;
  right: 10%;
  width: 50%;
  height: 50%;
  background: var(--accent);
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* ── Status dot ──────────────────────────────────────────────────────────── */
.dot-active {
  background-color: #22c55e !important;
  animation: dot-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.dot-inactive {
  background-color: #d1d5db !important;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Tool indicator badge ────────────────────────────────────────────────── */
.tool-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--brand-navy);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

/* ── Waveform bars ───────────────────────────────────────────────────────── */
.bar {
  width: 6px;
  background-color: var(--accent);
  border-radius: 9999px;
  animation: wave 1.5s ease-in-out infinite;
  height: 20px;
}

.bar:nth-child(1)  { animation-delay: 0.00s; }
.bar:nth-child(2)  { animation-delay: 0.10s; }
.bar:nth-child(3)  { animation-delay: 0.20s; }
.bar:nth-child(4)  { animation-delay: 0.30s; }
.bar:nth-child(5)  { animation-delay: 0.40s; }
.bar:nth-child(6)  { animation-delay: 0.50s; }
.bar:nth-child(7)  { animation-delay: 0.40s; }
.bar:nth-child(8)  { animation-delay: 0.30s; }
.bar:nth-child(9)  { animation-delay: 0.20s; }
.bar:nth-child(10) { animation-delay: 0.10s; }
.bar:nth-child(11) { animation-delay: 0.05s; }
.bar:nth-child(12) { animation-delay: 0.00s; }

@keyframes wave {
  0%, 100% {
    height: 16px;
    opacity: 0.3;
  }
  50% {
    height: 80px;
    opacity: 1.0;
  }
}

/* ── Start / end session buttons ─────────────────────────────────────────── */
.start-btn:hover,
.stop-btn:hover {
  border-color: var(--accent-border);
}

.start-btn:hover svg,
.start-btn:hover .start-label,
.stop-btn:hover svg {
  color: var(--brand-navy);
}

.accent-text {
  color: var(--accent);
}

/* ── Capability cards ────────────────────────────────────────────────────── */
.icon-chip {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--brand-navy);
}

.tool-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 20rem;
  max-width: 90vw;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 14px 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 50;
}

.capability-card:hover .tool-tooltip,
.capability-card:focus-within .tool-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* caret */
.tool-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #fff;
  filter: drop-shadow(0 1px 0 #e5e7eb);
}

.tool-tooltip h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-navy);
  font-weight: 600;
  margin-bottom: 10px;
}

.tool-tooltip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tool-tooltip li {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tool-tooltip li strong {
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
}

.tool-tooltip li span {
  font-size: 11px;
  line-height: 1.4;
  color: #6b7280;
}

/* ── Test data / reset buttons (on the blue header) ──────────────────────── */
.test-data-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.test-data-btn:hover {
  background: #fff;
  color: var(--brand-navy);
}

.test-data-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(2px);
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 1100px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--brand-navy);
}

.modal-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 16px;
}

.modal-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  margin-top: 24px;
  margin-bottom: 6px;
}

.modal-table-wrap {
  flex-shrink: 0;
  overflow-x: auto;
  border: 1px solid #f3f4f6;
  border-radius: 10px;
}

/* ── Test data tables ────────────────────────────────────────────────────── */
.auth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.auth-table th {
  text-align: left;
  background: #f9fafb;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.auth-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  white-space: nowrap;
}

.auth-table td.wrap {
  white-space: pre-line;
  min-width: 260px;
}

.auth-table td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  color: var(--brand-navy);
}

.auth-table tr:last-child td {
  border-bottom: none;
}

.auth-table tbody tr:hover td {
  background: var(--accent-soft);
}

.auth-table tr.muted td {
  color: #9ca3af;
}

.auth-table-empty {
  text-align: center;
  color: #9ca3af;
  white-space: normal;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
/* .tool-badge sets display: flex, so hidden must win regardless of stylesheet order. */
.hidden {
  display: none !important;
}
