/* Dental AI Receptionist Demo — app.css */

:root {
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-light: #ccfbf1;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-400: #94a3b8;
  --slate-100: #f1f5f9;
  --white: #ffffff;
  --amber: #f59e0b;
  --red: #ef4444;
  --green: #10b981;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--slate-100);
  color: var(--slate-900);
  min-height: 100vh;
}

.header {
  background: var(--teal);
  color: white;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.header-subtitle {
  font-size: 0.8rem;
  opacity: 0.85;
  font-weight: 400;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.15);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.status-dot.offline { background: var(--amber); }

.main-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: white;
  padding: 0.35rem;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
}

.tab {
  padding: 0.6rem 1.2rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-700);
  transition: all 0.15s;
}

.tab.active {
  background: var(--teal);
  color: white;
}

.tab:hover:not(.active) { background: var(--slate-100); }

/* Card */
.card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title-icon {
  width: 28px;
  height: 28px;
  background: var(--teal-light);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* Phone simulator */
.phone-frame {
  background: #111;
  border-radius: 40px;
  padding: 20px;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.05);
}

.phone-screen {
  background: #0a0a0a;
  border-radius: 28px;
  padding: 1.25rem;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.phone-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.phone-time {
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}

.phone-signal {
  display: flex;
  gap: 3px;
  align-items: flex-end;
}

.phone-signal span {
  width: 4px;
  background: rgba(255,255,255,0.5);
  border-radius: 2px;
}

.phone-signal span:nth-child(1) { height: 6px; }
.phone-signal span:nth-child(2) { height: 10px; }
.phone-signal span:nth-child(3) { height: 14px; }
.phone-signal span:nth-child(4) { height: 18px; }
.phone-signal span.active { background: var(--teal); }

.call-info-bar {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.call-info-label {
  font-size: 0.7rem;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.call-info-value {
  font-size: 0.8rem;
  color: white;
  font-weight: 600;
}

.call-badge {
  font-size: 0.65rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}

.call-badge.inbound {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green);
}

.call-badge.after-hours {
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber);
}

/* Conversation */
.conversation {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.conversation::-webkit-scrollbar { width: 4px; }
.conversation::-webkit-scrollbar-track { background: transparent; }
.conversation::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: msgIn 0.3s ease-out;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.ai {
  align-self: flex-start;
}

.msg.caller {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-bubble {
  padding: 0.65rem 0.9rem;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.msg.ai .msg-bubble {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.msg.caller .msg-bubble {
  background: var(--teal);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-label {
  font-size: 0.65rem;
  color: var(--slate-400);
  margin-top: 0.25rem;
  padding: 0 0.25rem;
}

.msg.caller .msg-label { text-align: right; }

/* Thinking indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 0.75rem;
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--slate-400);
  border-radius: 50%;
  animation: dotBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input */
.input-area {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.msg-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 0.65rem 1rem;
  color: white;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.msg-input::placeholder { color: var(--slate-400); }
.msg-input:focus { border-color: var(--teal); }

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--teal);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}

.send-btn:hover { background: var(--teal-dark); transform: scale(1.05); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Quick replies */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.quick-reply {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  color: var(--slate-400);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-reply:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}

/* Scenario selector */
.scenario-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.scenario-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.3rem 0.65rem;
  font-size: 0.7rem;
  color: var(--slate-400);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.scenario-btn:hover {
  background: rgba(255,255,255,0.12);
  color: white;
  border-color: rgba(255,255,255,0.2);
}

.scenario-btn span {
  color: var(--teal);
  font-size: 0.8rem;
}

/* Right panel */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Office info card */
.office-info {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.office-info-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--slate-700);
}

.office-info-icon {
  width: 20px;
  height: 20px;
  color: var(--teal);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Appointment list */
.apt-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
}

.apt-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--slate-100);
  border-radius: 10px;
  border-left: 3px solid transparent;
  transition: border-color 0.2s;
}

.apt-item.confirmed { border-left-color: var(--green); }
.apt-item.pending { border-left-color: var(--amber); }

.apt-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate-900);
  min-width: 60px;
}

.apt-name {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--slate-900);
  flex: 1;
}

.apt-service {
  font-size: 0.75rem;
  color: var(--slate-400);
}

.apt-status {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.apt-status.confirmed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.apt-status.pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber);
}

/* Call log */
.call-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 200px;
  overflow-y: auto;
}

.call-log-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: var(--slate-100);
  font-size: 0.8rem;
}

.call-log-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.call-log-icon.inbound { background: rgba(16, 185, 129, 0.12); color: var(--green); }
.call-log-icon.outbound { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }

.call-log-name { font-weight: 600; color: var(--slate-900); flex: 1; }
.call-log-outcome { font-size: 0.7rem; color: var(--slate-400); }
.call-log-time { font-size: 0.7rem; color: var(--slate-400); }

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--slate-100);
  border-radius: 12px;
  padding: 0.85rem;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--slate-400);
  margin-top: 0.25rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--slate-400);
}

.empty-state p {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* CTA button */
.btn-teal {
  background: var(--teal);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-teal:hover { background: var(--teal-dark); }

.btn-ghost {
  background: transparent;
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-ghost:hover { background: var(--slate-100); }

/* Badge pill */
.badge {
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* Scenario panel */
.scenario-panel {
  background: var(--slate-100);
  border-radius: 10px;
  padding: 0.85rem;
}

.scenario-panel-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.loading-bar {
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.loading-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 2px;
  animation: loadingSlide 1.2s ease-in-out infinite;
  width: 30%;
}

@keyframes loadingSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* Confirmation overlay */
.confirm-banner {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #6ee7b7;
}

.confirm-banner strong { color: var(--green); }

@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .side-panel { order: -1; }
}