/* =========================================
   VITANEX.AI — PREMIUM CLEAN CLINICAL LIGHT & MODERN MEDICAL THEME
   ========================================= */

:root {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-hover: #1e293b;
  --sidebar-active: #2563eb;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent-cyan: #06b6d4;
  --accent-blue: #2563eb;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;
  --radius-lg: 24px;
  --radius-sm: 12px;
  --shadow-card: 0 12px 35px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --font-sans: "Plus Jakarta Sans", "Inter", sans-serif;
  --font-display: "Space Grotesk", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Main Content */
.main-content {
  margin-left: 0;
  flex: 1;
  padding: 30px 48px;
  max-width: 100vw;
  animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Top Reference Navigation Tabs Bar */
.topbar-ref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
}

.topbar-ref-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ref-tab {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s ease;
}

.ref-tab:hover {
  background: #e2e8f0;
  color: var(--text-main);
  transform: translateY(-1px);
}

.ref-tab.active, .ref-tab.active-pill {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

#languageSelect {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

/* View Sections (Single Page Navigation) */
.view-section {
  display: none;
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
  display: block;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

/* Top Patient Metric Bar */
.patient-metric-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
}

.metric-pill .label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.metric-pill .val {
  font-size: 20px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-pill .tag-delta {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  background: #f0fdf4;
  color: var(--accent-emerald);
}

/* Hero & Cardiology Grid */
.hero-card-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 28px;
  align-items: stretch;
}

.hero-visual-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  height: 420px;
}

.visual-label {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 1px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  box-shadow: 0 0 10px var(--accent-rose);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

#scene-container { width: 100%; height: 100%; }

.scene-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 56px;
  color: var(--accent-rose);
}

.visual-caption {
  position: absolute;
  bottom: 16px;
  right: 24px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

/* Dashboard Panels & Health Risk Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.panel {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.panel:hover {
  border-color: #cbd5e1;
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--accent-blue);
}

.panel-icon { font-size: 20px; }

.panel h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-main);
}

.muted { color: var(--text-muted); font-size: 13px; }

.panel input, .panel textarea, .panel select {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.panel input:focus, .panel textarea:focus, .panel select:focus {
  border-color: var(--accent-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-blue);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.button-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  box-shadow: none;
}

.button-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.button-small { padding: 8px 16px; font-size: 12px; }

.progress-track {
  height: 10px;
  width: 100%;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: inherit;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 20px;
  background: #eff6ff;
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
}

.demo-badge {
  padding: 6px 14px;
  border-radius: 20px;
  background: #eff6ff;
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 700;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
}

.section-heading p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

.gradient-text {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 900px) {
  .main-content { padding: 20px; }
  .hero-card-grid, .dashboard-grid { grid-template-columns: 1fr; }
}
