:root {
  color-scheme: dark;
  --bg: #090d16;
  --panel-bg: rgba(17, 24, 39, 0.75);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --success: #10b981;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
}

main {
  width: min(1300px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 80px;
}

/* Header */
header {
  margin-bottom: 32px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  color: #a5b4fc;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 780px;
  line-height: 1.6;
  margin: 0;
}

/* Panels */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

/* Interactive Demo Card */
.demo-panel {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.6) 0%, rgba(17, 24, 39, 0.8) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.demo-header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.demo-icon {
  font-size: 2.4rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.demo-header h2 {
  font-family: 'Outfit', sans-serif;
  margin: 0 0 6px;
  font-size: 1.5rem;
  color: #fff;
}

.demo-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 550px;
}

.demo-controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-group input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  width: 180px;
  transition: all 0.2s;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Buttons */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  padding: 13px 24px;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 10px 18px;
  font-size: 0.9rem;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Upload Panel */
.upload-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.upload-panel h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.upload-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

form {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="file"] {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Table */
.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.table-heading h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.table-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

th {
  color: #94a3b8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

td small {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.badge.high {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.completed, .badge.interested {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.table-btn:hover {
  background: rgba(99, 102, 241, 0.4);
}

/* Active Call Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal.hidden {
  display: none;
  opacity: 0;
}

.modal-card {
  width: min(580px, calc(100% - 32px));
  background: #111827;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 50px rgba(99, 102, 241, 0.2);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.call-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.call-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.agent-avatar {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.call-identity h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-family: 'Outfit', sans-serif;
  color: #fff;
}

.call-status {
  font-size: 0.85rem;
  color: #34d399;
  font-weight: 500;
}

.timer-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
}

/* Sound Wave Animation */
.visualizer-container {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sound-wave {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
}

.bar {
  width: 5px;
  height: 12px;
  background: linear-gradient(to top, #6366f1, #38bdf8);
  border-radius: 99px;
  transition: height 0.15s ease;
  animation: wave 1.2s ease-in-out infinite alternate;
}

.bar:nth-child(1) { animation-delay: 0.1s; }
.bar:nth-child(2) { animation-delay: 0.25s; }
.bar:nth-child(3) { animation-delay: 0.4s; }
.bar:nth-child(4) { animation-delay: 0.15s; }
.bar:nth-child(5) { animation-delay: 0.3s; }
.bar:nth-child(6) { animation-delay: 0.5s; }
.bar:nth-child(7) { animation-delay: 0.2s; }
.bar:nth-child(8) { animation-delay: 0.35s; }
.bar:nth-child(9) { animation-delay: 0.1s; }

.wave-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Transcript Box */
.transcript-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 85%;
  font-size: 0.9rem;
  line-height: 1.45;
}

.chat-bubble.bot {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  align-self: flex-start;
  color: #e0e7ff;
}

.chat-bubble.user {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  align-self: flex-end;
  color: #f8fafc;
}

.bubble-role {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #a5b4fc;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-bubble.user .bubble-role {
  color: #94a3b8;
}

.chat-bubble p {
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: center;
}

.end-call-btn {
  background: var(--danger);
  color: #fff;
  padding: 14px 36px;
  font-size: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.end-call-btn:hover {
  background: var(--danger-hover);
  transform: translateY(-1px);
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

@keyframes wave {
  0% { height: 8px; }
  100% { height: 42px; }
}

@media (max-width: 768px) {
  .demo-panel {
    flex-direction: column;
    align-items: stretch;
  }
  .demo-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .input-group input {
    width: 100%;
  }
  .upload-panel {
    flex-direction: column;
    align-items: stretch;
  }
}
