:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 35px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  --font-hindi: 'Noto Sans Devanagari', sans-serif;
  --font-punjabi: 'Noto Sans Gurmukhi', sans-serif;
}

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

.hidden {
  display: none !important;
}

body.light-theme {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.92);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

/* Vidmate Style Feature Showcase Card */
.feature-showcase-card {
  padding: 28px 24px 24px;
}

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

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid #bfdbfe;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.sparkle-icon {
  animation: spinSlow 6s linear infinite;
}

@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.icon-btn {
  background: var(--bg-subtle);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: #e2e8f0;
  color: var(--text-primary);
  transform: scale(1.05);
}

.hero-intro {
  text-align: center;
  margin-bottom: 26px;
}

.hero-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
}

.hero-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: #e0f2fe;
  border: 3px solid #ffffff;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 2;
}

.avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: var(--radius-full);
  border: 2px dashed #3b82f6;
  animation: rotateRing 12s linear infinite;
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.live-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--success);
  border: 2px solid #ffffff;
  border-radius: var(--radius-full);
  z-index: 3;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.hero-intro h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.highlight-text {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
  font-family: var(--font-urdu), var(--font-sans);
}

/* Features Grid (Vidmate Style) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.feature-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.feature-item:hover {
  transform: translateY(-4px);
  border-color: #93c5fd;
  box-shadow: var(--shadow-md);
}

.f-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.bg-blue { background: #eff6ff; color: #2563eb; }
.bg-green { background: #ecfdf5; color: #059669; }
.bg-purple { background: #f5f3ff; color: #7c3aed; }
.bg-amber { background: #fffbeb; color: #d97706; }
.bg-rose { background: #fff1f2; color: #e11d48; }
.bg-cyan { background: #ecfeff; color: #0891b2; }

.f-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0 3px;
  font-family: var(--font-urdu), var(--font-sans);
}

.f-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
  font-family: var(--font-urdu), var(--font-sans);
}

.f-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eff6ff;
  color: #2563eb;
  text-transform: uppercase;
}

.green-badge { background: #ecfdf5; color: #059669; }
.purple-badge { background: #f5f3ff; color: #7c3aed; }
.amber-badge { background: #fffbeb; color: #d97706; }
.rose-badge { background: #fff1f2; color: #e11d48; }
.cyan-badge { background: #ecfeff; color: #0891b2; }

.modal-footer-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.btn-call-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-call-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

/* Voice Call Modal Screen - Professional Executive UI */
.call-screen-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 60%, #f0fdf4 100%);
  border: 1px solid #cbd5e1;
  border-radius: 32px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  width: 100%;
  max-width: 440px;
  padding: 24px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.call-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.call-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: liveDotPulse 1.8s infinite;
}

@keyframes liveDotPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.call-timer-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.call-hd-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: #059669;
  background: #ecfdf5;
  padding: 2px 6px;
  border-radius: 4px;
}

.icon-btn-sm {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.icon-btn-sm:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: scale(1.05);
}

.call-avatar-container {
  position: relative;
  width: 124px;
  height: 124px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-main-avatar {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  border: 4px solid #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 5;
  transition: transform 0.3s ease;
}

.call-avatar-state-badge {
  position: absolute;
  bottom: 8px;
  right: 12px;
  z-index: 10;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.call-avatar-state-badge.speaking {
  background: #2563eb;
  color: #ffffff;
  animation: badgeBounce 1.5s infinite;
}

.call-avatar-state-badge.listening {
  background: #10b981;
  color: #ffffff;
  animation: badgeBounce 1.5s infinite;
}

.call-avatar-state-badge.thinking {
  background: #f59e0b;
  color: #ffffff;
}

@keyframes badgeBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.call-wave-circle {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  border: 2px solid #3b82f6;
  opacity: 0.5;
  animation: callPulse 2.4s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

.call-wave-circle.listening {
  border-color: #10b981;
}

.wave-2 { animation-delay: 0.8s; }
.wave-3 { animation-delay: 1.6s; }

@keyframes callPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.55); opacity: 0; }
}

.call-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.call-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.call-verified-badge {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.call-voice-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.call-status-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-family: var(--font-urdu), var(--font-sans);
  transition: all 0.3s ease;
}

.call-status-card.speaking {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.call-status-card.listening {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.call-status-card.thinking {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

.status-pulse-icon {
  font-size: 0.9rem;
  animation: spinPulse 2s infinite ease-in-out;
}

@keyframes spinPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.call-status {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.visualizer-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  margin: 10px 0 14px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

#waveformCanvas {
  width: 100%;
  height: 64px;
}

.call-transcript-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: right;
  margin-bottom: 18px;
  max-height: 105px;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.transcript-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
}

.transcript-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.call-turn-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.call-turn-badge.ai-turn {
  background: #dbeafe;
  color: #1e40af;
}

.call-turn-badge.user-turn {
  background: #d1fae5;
  color: #065f46;
}

.call-turn-badge.thinking-turn {
  background: #fef3c7;
  color: #92400e;
}

.transcript-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.5;
  font-family: var(--font-urdu), var(--font-sans);
}

.call-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}

.call-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.call-btn:hover {
  transform: translateY(-2px);
}

.call-btn i {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.btn-mute i { background: #f1f5f9; color: var(--text-primary); border: 1px solid #e2e8f0; }
.btn-mute.muted i { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }

.btn-speaker i { background: #f1f5f9; color: var(--text-primary); border: 1px solid #e2e8f0; }
.btn-speaker.active i { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }

.btn-tap-speak i {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-tap-speak.listening i {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  animation: pulseButton 1.5s infinite;
}

@keyframes pulseButton {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.btn-hangup i {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  width: 54px;
  height: 54px;
  font-size: 1.4rem;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4);
}

.btn-hangup:hover i {
  background: #b91c1c;
  transform: scale(1.08);
}

/* Settings Modal */
.settings-card {
  padding: 24px;
  max-width: 520px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.settings-body .form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-with-icon input {
  padding-left: 36px;
}

.help-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-top: 5px;
}

.slider {
  width: 100%;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.toggle-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.settings-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

/* ========================================================
   ENTERPRISE SAAS APP LAYOUT & CHAT HISTORY SIDEBAR
   ======================================================== */
.enterprise-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #f8fafc;
}

/* Collapsible Left Sidebar */
.chat-sidebar {
  width: 290px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), margin 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-sidebar.collapsed {
  margin-left: -290px;
}

.sidebar-top {
  padding: 16px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-avatar-box {
  position: relative;
  width: 36px;
  height: 36px;
}

.brand-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #eff6ff;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

.brand-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.brand-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.1;
  display: block;
}

.brand-sub {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.sidebar-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sidebar-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sidebar-action-wrap {
  padding: 12px 14px 6px;
}

.btn-new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-new-chat:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.sidebar-history-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}

.history-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  padding: 6px 6px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-clean-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.75rem;
  transition: color 0.2s;
}

.history-clean-btn:hover {
  color: #ef4444;
}

.history-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.history-session-item:hover {
  background: #f1f5f9;
}

.history-session-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.session-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
}

.session-icon {
  font-size: 0.8rem;
  color: #3b82f6;
  flex-shrink: 0;
}

.session-title {
  font-size: 0.85rem;
  color: #1e293b;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-del-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.history-session-item:hover .session-del-btn {
  opacity: 1;
}

.session-del-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.history-empty-state {
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
  padding: 24px 10px;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}

.system-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.status-pulse-green {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.sidebar-settings-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sidebar-settings-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

/* Workspace Area */
.workspace-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: #ffffff;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 45;
}

/* Header */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-name-row h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.badge-tech {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-pro {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-model {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

.header-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-urdu), var(--font-sans);
}

.search-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: #3b82f6;
  animation: pulseLight 2s infinite;
}

@keyframes pulseLight {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-selector-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.lang-selector-pill select {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.btn-pill-features {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  color: #db2777;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-urdu), var(--font-sans);
}

.btn-pill-features:hover {
  background: #fce7f3;
  transform: translateY(-1px);
}

.btn-pill-call {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
  animation: subtleShake 5s ease infinite;
}

@keyframes subtleShake {
  0%, 90%, 100% { transform: scale(1); }
  92%, 96% { transform: scale(1.05); }
  94%, 98% { transform: scale(0.98); }
}

.btn-pill-call:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.icon-btn-header {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn-header:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

/* Feature Ticker Ribbon */
.feature-ticker {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  padding: 6px 16px;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  animation: tickerSlide 25s linear infinite;
  font-family: var(--font-urdu), var(--font-sans);
}

@keyframes tickerSlide {
  0% { transform: translateX(10%); }
  100% { transform: translateX(-40%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ticker-divider {
  color: #cbd5e1;
}

.text-amber { color: #f59e0b; }
.text-green { color: #10b981; }
.text-purple { color: #8b5cf6; }
.text-blue { color: #3b82f6; }
.text-rose { color: #e11d48; }

/* Main Chat Container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

/* Message Rows */
.message-row {
  display: flex;
  gap: 12px;
  max-width: 82%;
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.user-row {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.bot-row {
  align-self: flex-start;
}

.msg-avatar-wrap {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.msg-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: #e0f2fe;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

.msg-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.msg-author-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}

.author-name {
  font-weight: 700;
  color: var(--text-primary);
}

.author-badge {
  background: #eff6ff;
  color: #2563eb;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
}

.msg-time {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.msg-content {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: 18px;
  border-top-left-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  word-break: break-word;
}

.user-row .msg-content {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-top-left-radius: 18px;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.msg-content p {
  margin-bottom: 8px;
}

.msg-content p:last-child {
  margin-bottom: 0;
}

/* RTL Language font enhancements */
.lang-rtl {
  direction: rtl;
  text-align: right;
  font-family: var(--font-urdu), var(--font-sans);
}

.lang-hindi {
  font-family: var(--font-hindi), var(--font-sans);
}

.lang-punjabi {
  font-family: var(--font-punjabi), var(--font-sans);
}

/* Welcome Feature Highlight Cards inside message */
.welcome-features-highlight {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
}

.w-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-primary);
  font-family: var(--font-urdu), var(--font-sans);
}

/* Search Source Citation Cards */
.sources-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
}

.sources-header {
  font-size: 0.76rem;
  font-weight: 700;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.source-chip:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

/* Message Actions */
.msg-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.msg-action-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.msg-action-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* Live Search Status Bar */
.search-status-bar {
  background: linear-gradient(90deg, #eff6ff 0%, #ecfdf5 100%);
  border-top: 1px solid #bfdbfe;
  border-bottom: 1px solid #a7f3d0;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideInDown 0.25s ease;
}

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

.search-status-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.search-text-block {
  display: flex;
  flex-direction: column;
}

.search-status-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e40af;
  font-family: var(--font-urdu), var(--font-sans);
}

.search-status-query {
  font-size: 0.72rem;
  color: #047857;
}

/* Quick Prompts Bar */
.quick-prompts-bar {
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
}

.quick-prompts-bar::-webkit-scrollbar {
  height: 4px;
}

.quick-prompts-bar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.prompt-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-family: var(--font-urdu), var(--font-sans);
}

.prompt-chip:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
  transform: translateY(-1px);
}

/* Chat Input Bar */
.chat-input-wrap {
  padding: 12px 20px 16px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
}

.input-container-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 6px 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.input-container-inner:focus-within {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.mic-dictate-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mic-dictate-btn:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.mic-dictate-btn.recording {
  background: #fee2e2;
  color: #ef4444;
  animation: pulseRecording 1.2s infinite;
}

@keyframes pulseRecording {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

#chatInput {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding: 8px 6px;
  font-family: var(--font-urdu), var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
  resize: none;
  max-height: 120px;
  line-height: 1.5;
}

.input-call-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: #ecfdf5;
  color: #059669;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.input-call-btn:hover {
  background: #10b981;
  color: #ffffff;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.input-footer-note {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: var(--font-urdu), var(--font-sans);
}

/* ========================================================
   COMPREHENSIVE RESPONSIVE DESIGN (MOBILE, TABLET, LAPTOP)
   ======================================================== */

/* Mobile & Tablet Devices (max-width: 768px) */
@media (max-width: 768px) {
  .chat-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 86vw;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    margin-left: 0 !important;
    z-index: 1000;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.35);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .chat-sidebar.open,
  .chat-sidebar.active {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.open,
  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .app-header {
    padding: 8px 12px;
    min-height: 56px;
    gap: 8px;
  }

  .header-left {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .header-name-row h1 {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .badge-tech, .badge-pro {
    display: none;
  }

  .header-subtitle {
    font-size: 0.65rem;
  }

  .header-right {
    gap: 4px;
    flex-shrink: 0;
  }

  .btn-pill-call {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .model-selector-pill {
    padding: 3px 6px;
  }

  .model-selector-pill select {
    max-width: 82px;
    font-size: 0.72rem;
  }

  .lang-selector-pill select {
    max-width: 58px;
    font-size: 0.72rem;
  }

  .icon-btn-header {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  #clearChatBtn, #exportChatBtn {
    display: none;
  }

  .chat-container {
    padding: 10px 8px;
  }

  .chat-messages {
    padding: 6px 2px;
  }

  .message-row {
    gap: 8px;
    margin-bottom: 12px;
  }

  .msg-avatar-wrap {
    width: 32px;
    height: 32px;
  }

  .msg-bubble-wrap {
    max-width: 93%;
    padding: 10px 14px;
  }

  .chat-input-wrap {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .input-container-inner {
    padding: 5px 8px;
    gap: 4px;
  }

  #chatInput {
    font-size: 15px;
    min-height: 24px;
  }

  .tool-btn, .mic-dictate-btn, .input-call-btn {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
  }

  .send-btn {
    width: 34px;
    height: 34px;
  }

  /* Responsive Voice Call Modal */
  .call-screen-card {
    max-width: 95vw;
    max-height: 92dvh;
    padding: 16px 14px 18px;
  }

  .call-avatar-container {
    margin: 12px auto 14px;
    width: 96px;
    height: 96px;
  }

  .call-main-avatar {
    width: 80px;
    height: 80px;
  }

  .call-name {
    font-size: 1.15rem;
  }

  .visualizer-container canvas {
    max-width: 100%;
    height: 48px;
  }

  .call-transcript-box {
    padding: 8px 12px;
    max-height: 64px;
    font-size: 0.8rem;
  }

  .call-controls {
    gap: 8px;
    margin-top: 12px;
  }

  .call-btn {
    width: 48px;
    height: 48px;
    font-size: 0.72rem;
  }

  .btn-tap-speak {
    width: 60px;
    height: 60px;
  }
}

/* Laptops & Desktops (min-width: 1024px) */
@media (min-width: 1024px) {
  .chat-container {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
  }

  .chat-input-wrap {
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
  }
}

/* ========================================================
   PROFESSIONAL AI BADGES & CONTROLS
   ======================================================== */

.bg-blue { background: #eff6ff; color: #2563eb; }
.blue-badge { background: #dbeafe; color: #1e40af; }
.text-blue { color: #2563eb; }

.highlight-card {
  border-color: #bfdbfe !important;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12) !important;
}

.voice-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  gap: 12px;
}

.v-emoji {
  font-size: 1.8rem;
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.btn-text-action {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-text-action:hover {
  text-decoration: underline;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.voice-indicator-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
}

/* Chat Input Tool Buttons (Clip & Audio Note) */
.tool-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tool-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

/* Attachment Preview */
.attachment-preview {
  padding: 8px 20px 0;
  background: #ffffff;
}

.att-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: #1e40af;
}

.att-remove-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #ef4444;
  margin-left: 4px;
}

/* Voice Note Recording Bar */
.recording-bar {
  background: #fff1f2;
  border-top: 1px solid #fecdd3;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideInUp 0.2s ease;
}

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

.recording-wave-dot {
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  from { transform: scale(0.8); opacity: 0.6; }
  to { transform: scale(1.4); opacity: 1; }
}

.recording-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #be123c;
  flex: 1;
  font-family: var(--font-urdu), var(--font-sans);
}

.recording-timer {
  font-size: 0.88rem;
  font-weight: 800;
  color: #e11d48;
  font-family: monospace;
}

.btn-cancel-rec {
  background: #fecdd3;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #be123c;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-send-rec {
  background: #10b981;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Audio Player Card in Chat */
.audio-player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 12px;
  margin: 6px 0;
}

.user-row .audio-player-card {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.audio-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.user-row .audio-play-btn {
  background: #ffffff;
  color: var(--primary);
}

.audio-visual-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  flex: 1;
}

.audio-bar {
  width: 3px;
  background: #94a3b8;
  border-radius: 2px;
  transition: height 0.15s ease;
}

.user-row .audio-bar {
  background: rgba(255, 255, 255, 0.7);
}

.audio-bar.playing {
  animation: barBounce 0.6s infinite ease-in-out alternate;
}

@keyframes barBounce {
  from { height: 6px; }
  to { height: 22px; }
}

.audio-duration {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-muted);
}

.user-row .audio-duration {
  color: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   ENTERPRISE FEATURES ADDITIONS: DARK THEME, CODE BLOCKS, STREAMING, TOUR
   ========================================================================== */

/* Dark Theme Palette */
body.dark-theme {
  --bg-main: #0b0f19;
  --bg-card: #131b2e;
  --bg-subtle: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --border-focus: #60a5fa;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.16);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 35px -5px rgba(0, 0, 0, 0.7);

  background-color: #0b0f19;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.14) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  color: var(--text-primary);
}

body.dark-theme .chat-sidebar {
  background: #0f172a;
  border-right-color: #1e293b;
}

body.dark-theme .app-header {
  background: rgba(15, 23, 42, 0.85);
  border-bottom-color: #1e293b;
}

body.dark-theme .bot-row .msg-bubble-wrap {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-theme .btn-new-chat {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}
body.dark-theme .btn-new-chat:hover {
  background: #2563eb;
  color: #ffffff;
}

body.dark-theme .history-session-item {
  color: #cbd5e1;
  border-color: transparent;
}
body.dark-theme .history-session-item:hover {
  background: #1e293b;
}
body.dark-theme .history-session-item.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

body.dark-theme .chat-input-wrap {
  background: rgba(15, 23, 42, 0.9);
  border-top-color: #1e293b;
}

body.dark-theme .input-container-inner {
  background: #1e293b;
  border-color: #334155;
}

body.dark-theme #chatInput {
  color: #f8fafc;
}

body.dark-theme .prompt-chip {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
body.dark-theme .prompt-chip:hover {
  background: #2563eb;
  color: #ffffff;
}

body.dark-theme .lang-selector-pill,
body.dark-theme .model-selector-pill {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-theme .lang-selector-pill select,
body.dark-theme .model-selector-pill select {
  background: transparent;
  color: #f8fafc;
}

body.dark-theme .icon-btn-header {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
body.dark-theme .icon-btn-header:hover {
  background: #334155;
  color: #ffffff;
}

body.dark-theme .modal-card {
  background: #111827;
  border-color: #334155;
  color: #f8fafc;
}

body.dark-theme .sources-box {
  background: #0f172a;
  border-color: #1e293b;
}

body.dark-theme .source-chip {
  background: #1e293b;
  border-color: #334155;
  color: #93c5fd;
}

body.dark-theme .audio-player-card {
  background: #1e293b;
  border-color: #334155;
}

/* Header Model Selector Pill */
.model-selector-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.model-selector-pill select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

/* Typing Indicator Bubble */
.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* Streaming Active Blinking Cursor */
.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: var(--primary);
  margin-left: 2px;
  vertical-align: middle;
  animation: cursorBlink 0.8s infinite;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Stop Generating Button */
.btn-stop-generating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 6px;
}

.btn-stop-generating:hover {
  background: #fca5a5;
  color: #b91c1c;
}

/* Scroll To Bottom Floating Button */
.scroll-to-bottom-btn {
  position: absolute;
  bottom: 96px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-to-bottom-btn:hover {
  transform: translateY(-2px);
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.scroll-to-bottom-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

/* Markdown Code Block Wrapper */
.code-block-wrapper {
  margin: 12px 0;
  background: #0f172a;
  border-radius: 12px;
  border: 1px solid #1e293b;
  overflow: hidden;
  direction: ltr !important;
  text-align: left !important;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  color: #94a3b8;
  font-size: 0.76rem;
  font-family: monospace;
}

.btn-copy-code {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.code-block-wrapper pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #e2e8f0;
}

code.inline-code {
  background: var(--bg-subtle);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: monospace;
  font-size: 0.88em;
  direction: ltr !important;
  display: inline-block;
}

/* Onboarding Interactive Tour Modal (VidMate style) */
.tour-card {
  max-width: 540px;
  width: 95%;
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-header {
  padding: 24px 24px 12px;
  text-align: center;
  position: relative;
}

.tour-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.2);
}

.tour-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.tour-body {
  padding: 8px 24px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.tour-dots-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.tour-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-color);
  transition: all 0.25s ease;
}

.tour-dot.active {
  width: 24px;
  border-radius: 12px;
  background: var(--primary);
}

.tour-footer {
  padding: 16px 24px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-tour-skip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 12px;
}
.btn-tour-skip:hover {
  color: var(--text-primary);
}

.btn-tour-next {
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}
.btn-tour-next:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* ========================================================
   RICH ANIMATIONS & MICRO-INTERACTIONS
   ======================================================== */

/* Smooth Message Bubble Entrance with Spring Feel */
@keyframes messageEntrance {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  70% {
    opacity: 0.95;
    transform: translateY(-2px) scale(1.005);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message-row {
  animation: messageEntrance 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* AI Status Pulsing Glow */
@keyframes statusGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.status-pulse-green,
.brand-status-dot {
  animation: statusGlow 2s infinite ease-in-out;
}

/* Interactive Button Hover & Tactile Press */
.btn-pill-call,
.btn-new-chat,
.send-btn,
.icon-btn-header,
.msg-action-btn,
.tool-btn,
.mic-dictate-btn,
.input-call-btn,
.scroll-to-bottom-btn {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease !important;
}

.btn-pill-call:hover,
.btn-new-chat:hover,
.send-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28) !important;
}

.btn-pill-call:active,
.btn-new-chat:active,
.send-btn:active,
.icon-btn-header:active,
.msg-action-btn:active {
  transform: translateY(1px) scale(0.96) !important;
}

.icon-btn-header:hover {
  transform: translateY(-1px);
}

.msg-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Smooth Avatar Hover Interaction */
.msg-avatar,
.brand-avatar {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.msg-avatar:hover,
.brand-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

/* Global Smooth Theme Transition */
body,
.app-header,
.chat-sidebar,
.msg-bubble-wrap,
.chat-input-wrap,
.input-container-inner,
.modal-card,
.history-session-item {
  transition: background-color 0.28s ease, border-color 0.28s ease, color 0.28s ease, box-shadow 0.28s ease !important;
}

/* Pulse Animation for Waveform rings during call */
.call-wave-circle.wave-1 {
  animation: callWavePulse 2.4s infinite ease-out;
}
.call-wave-circle.wave-2 {
  animation: callWavePulse 2.4s infinite ease-out 0.8s;
}
.call-wave-circle.wave-3 {
  animation: callWavePulse 2.4s infinite ease-out 1.6s;
}

@keyframes callWavePulse {
  0% {
    transform: scale(0.85);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
