/* 
=========================================
  Artigenz Calling Dashboard: Command Center
  Core Style Sheet (Vanilla CSS)
=========================================
*/

:root {
  /* Color Palette - Artigenz Deep Tech Theme */
  --bg-main: #04060f;
  --bg-sidebar: #090a16;
  --bg-card: rgba(15, 17, 36, 0.7);
  --bg-card-hover: rgba(22, 25, 54, 0.9);
  --bg-glow: rgba(0, 242, 254, 0.12);
  
  --accent-cyan: #00f2fe;
  --accent-purple: #820ad1;
  --accent-blue: #1d4ed8;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #0ea5e9;

  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 242, 254, 0.2);
  
  /* Font Stacks */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Rules */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  background-image: 
    radial-gradient(at 0% 0%, rgba(130, 10, 209, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 242, 254, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 0%, rgba(29, 78, 216, 0.04) 0px, transparent 50%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* App Containers */
.app-container {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Sidebar Branding */
aside.sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  z-index: 10;
  flex-shrink: 0;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  margin-bottom: 1.5rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
  color: #000;
  font-weight: 800;
  font-family: var(--font-display);
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-size: 0.62rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  display: block;
}

/* Nav Menu */
nav.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
  box-shadow: inset 0 0 10px rgba(0, 242, 254, 0.02);
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--accent-cyan);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* Sidebar Footer Stats */
.sidebar-footer {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sys-stat-row {
  display: flex;
  justify-content: space-between;
}

.sys-stat-label {
  color: var(--text-muted);
}

.sys-stat-val {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Core Main Viewport */
main.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

header.top-header {
  height: 65px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(4, 6, 15, 0.8);
  backdrop-filter: blur(10px);
  z-index: 9;
}

.header-title h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}

.pulse-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.latency-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  color: var(--color-success);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.time-box {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-left: 1px solid var(--border-color);
  padding-left: 1rem;
}

.view-viewport {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
}

.view-section {
  display: none;
  animation: fadeIn var(--transition-normal);
  height: 100%;
}

.view-section.active-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cards & Layout Grid */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
  border-color: rgba(0, 242, 254, 0.12);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.metric-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-title {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}

.metric-trend {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-trend.up { color: var(--color-success); }
.metric-trend.down { color: var(--color-warning); }

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.dashboard-split {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 1.25rem;
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Call Table list style */
.call-table-wrapper {
  overflow-x: auto;
}

table.call-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.call-table th {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  text-transform: uppercase;
}

table.call-table td {
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  color: var(--text-primary);
}

table.call-table tr:hover td {
  background: rgba(255,255,255,0.01);
}

/* Status badging */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge.completed { background: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.badge.followup { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.badge.retry { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }
.badge.connected { background: rgba(0, 242, 254, 0.1); color: var(--accent-cyan); }
.badge.ringing { background: rgba(255,255,255,0.05); color: var(--text-secondary); }

/* =========================================
  CALL HUB (AUDIO RECORDINGS & TRANSCRIPT)
========================================= */
.call-hub-layout {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  gap: 1.25rem;
  height: calc(100vh - 150px);
}

.scroll-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.list-scroll {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Call Item Hub card */
.hub-call-item {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--border-color);
  padding: 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.hub-call-item:hover {
  background: rgba(255,255,255,0.03);
}

.hub-call-item.active {
  background: rgba(0, 242, 254, 0.03);
  border-color: rgba(0, 242, 254, 0.3);
}

/* Audio Waveform visual player */
.audio-player-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  cursor: pointer;
  font-weight: 700;
  transition: var(--transition-fast);
}

.play-btn:hover {
  transform: scale(1.05);
}

.audio-slider-bar {
  flex-grow: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.audio-progress {
  height: 100%;
  background: var(--accent-cyan);
  width: 0%;
  border-radius: 2px;
  transition: width 0.1s linear;
}

.player-timer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Audio waveform animated bars */
.waveform-bars {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 35px;
  padding: 0 1rem;
}

.wave-bar {
  width: 3px;
  height: 10%;
  background: var(--text-muted);
  border-radius: 1.5px;
  transition: height 0.15s ease, background-color 0.15s ease;
}

.waveform-bars.playing .wave-bar {
  background: var(--accent-cyan);
  animation: bounce-bar 1.2s ease-in-out infinite alternate;
}

/* Shift animations for wave-bars */
.waveform-bars.playing .wave-bar:nth-child(2n) { animation-delay: 0.1s; animation-duration: 0.9s; }
.waveform-bars.playing .wave-bar:nth-child(3n) { animation-delay: 0.25s; animation-duration: 1.4s; }
.waveform-bars.playing .wave-bar:nth-child(4n) { animation-delay: 0.05s; animation-duration: 0.8s; }
.waveform-bars.playing .wave-bar:nth-child(5n) { animation-delay: 0.3s; animation-duration: 1.1s; }

@keyframes bounce-bar {
  0% { height: 10%; }
  100% { height: 100%; }
}

/* Live transcript feed */
.transcript-feed {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.01);
  margin-bottom: 0.5rem;
}

.transcript-bubble {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: fadeIn 0.25s ease-out;
}

.transcript-bubble.ai { align-self: flex-start; }
.transcript-bubble.user { align-self: flex-end; }

.bubble-sender {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
  letter-spacing: 0.5px;
}

.transcript-bubble.ai .bubble-sender { color: var(--accent-cyan); }
.transcript-bubble.user .bubble-sender { color: var(--accent-purple); }

.bubble-text {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.transcript-bubble.ai .bubble-text {
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.1);
  border-topLeft-radius: 0;
}

.transcript-bubble.user .bubble-text {
  background: rgba(130, 10, 209, 0.06);
  border: 1px solid rgba(130, 10, 209, 0.15);
  border-topRight-radius: 0;
}

.bubble-time {
  font-size: 0.62rem;
  color: var(--text-muted);
  align-self: flex-end;
  margin-top: 0.2rem;
  font-family: var(--font-mono);
}

/* Outcome screening page elements */
.outcome-box {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-btn {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: #000;
  padding: 0.65rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
}

.action-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #fff;
}

.action-btn.secondary:hover {
  background: rgba(255,255,255,0.08);
  box-shadow: none;
}

/* =========================================
  AI CONFIG & PLAYGROUND
========================================= */
.playground-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  height: calc(100vh - 150px);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input, .form-textarea, .form-select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font-body);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.sandbox-container {
  display: flex;
  flex-direction: column;
  height: 250px;
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.85rem;
  overflow-y: auto;
  gap: 0.75rem;
}

/* =========================================
  PRICING & BILLING VIEW
========================================= */
.billing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.billing-card {
  text-align: center;
  padding: 1.5rem;
}

.billing-card-price {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin: 0.5rem 0;
}

/* =========================================
  PERFORMANCE MONITOR VIEW
========================================= */
.perf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.tool-performance-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.tool-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.tool-metric-box {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
}

.tool-metric-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-top: 0.15rem;
}

.tool-metric-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* LATENCY GAUGE BREAKDOWN STACK */
.latency-stack-container {
  display: flex;
  height: 25px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1rem;
}

.latency-stack-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: #000;
  transition: width 0.3s ease;
}

.latency-stack-segment.vad { background-color: var(--accent-cyan); }
.latency-stack-segment.asr { background-color: var(--color-info); }
.latency-stack-segment.llm { background-color: var(--accent-purple); }
.latency-stack-segment.tts { background-color: var(--color-warning); }
.latency-stack-segment.net { background-color: var(--text-secondary); }

/* =========================================
  NOTIFICATIONS, TOASTS & UTILITIES
========================================= */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}

.toast {
  background: rgba(15, 17, 36, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem 1.1rem;
  color: #fff;
  min-width: 250px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  animation: toastIn 0.2s ease-out;
  backdrop-filter: blur(10px);
}

.toast.success { border-color: rgba(16, 185, 129, 0.3); }
.toast.warning { border-color: rgba(245, 158, 11, 0.3); }
.toast.info { border-color: rgba(14, 165, 233, 0.3); }

/* =========================================
  KEYFRAME ANIMATIONS
========================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* =========================================
  RESPONSIVE QUERIES
========================================= */
@media (max-width: 1200px) {
  .metrics-row, .billing-grid { grid-template-columns: repeat(2, 1fr); }
  .call-hub-layout { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .playground-layout, .perf-grid { grid-template-columns: 1fr; }
  .dashboard-split { grid-template-columns: 1fr; }
}

/* =========================================
  MISSING / SDK UTILITY CLASSES
========================================= */

/* Inline search-style input (used in playground) */
.bi-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: var(--transition-fast);
}

.bi-search-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

/* Whitelisted SDK widget containers */
.ui-sdk-card {
  border-color: var(--border-glow);
}

.sdk-widget-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem;
  font-size: 0.82rem;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sdk-placeholder {
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  font-size: 0.78rem;
}

.sdk-calendar-widget {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sdk-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
}

.sdk-btn {
  background: var(--accent-cyan);
  color: #000;
  border: none;
  padding: 0.45rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.78rem;
  transition: var(--transition-fast);
}

.sdk-btn:hover {
  filter: brightness(1.1);
}

/* Pulsing dot animation */
.pulse-dot {
  animation: pulse-glow 1.5s infinite alternate;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 3px currentColor; opacity: 0.7; }
  100% { box-shadow: 0 0 10px currentColor; opacity: 1; }
}

/* Text utility */
.text-secondary {
  color: var(--text-secondary);
}
