/* ==========================================================================
   Main Design System & CSS Variables - Teletherapy Word Retrieval System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Tajawal:wght@400;500;700;800;900&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  /* Brand Palette - Deep Clinical Indigo & Soothing Teal */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  --accent-teal: #0d9488;
  --accent-cyan: #06b6d4;
  --accent-purple: #7c3aed;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;

  /* Neutral Spectrum */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  /* Dark HUD Mode for Specialist */
  --hud-bg: #0f172a;
  --hud-surface: #1e293b;
  --hud-card: #334155;
  --hud-text: #f8fafc;
  --hud-muted: #94a3b8;
  --hud-border: #475569;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);

  /* Radius & Transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Tajawal', 'Cairo', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Demo Mode Pitch Header Banner */
.pitch-demo-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  color: #fff;
  padding: 0.55rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  z-index: 100;
  position: relative;
}

.pitch-badge-tag {
  background: rgba(238, 242, 255, 0.2);
  color: #e0e7ff;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pitch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pitch-autoplay {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-pitch-autoplay:hover {
  transform: scale(1.04);
}

.btn-pitch-reset {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

/* App Header & Brand Bar */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-purple));
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.brand-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

/* Dual-Screen & Simulator Toggle */
.view-switcher-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
  display: flex;
  gap: 4px;
}

.view-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-btn.active {
  background: var(--primary-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-open-child {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-open-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35);
}

/* Stage Navigation Breadcrumb / Progress */
.stage-progress-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.stage-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.stage-step.active {
  background: var(--primary-50);
  color: var(--primary-700);
  border-color: var(--primary-500);
  font-weight: 800;
  box-shadow: 0 0 0 1px var(--primary-500);
}

.stage-step.completed {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.stage-step .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.stage-step.active .step-num {
  background: var(--primary-600);
  color: #fff;
}

.stage-step.completed .step-num {
  background: #10b981;
  color: #fff;
}

.stage-divider {
  color: var(--text-light);
  font-size: 0.8rem;
}

/* Containers & Views */
.main-viewport {
  padding: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 140px);
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

/* Primary Button Styling */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: var(--transition-fast);
}

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

.btn-secondary {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--border-color);
}
