/* ============================================================
   AI Health Diagnosis System — Design System
   Premium teal/mint-green healthcare theme
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Primary palette */
  --primary: #2EC4B6;
  --primary-light: #3DDBD0;
  --primary-dark: #1A9E8F;
  --primary-deeper: #148F82;
  --primary-gradient: linear-gradient(135deg, #2EC4B6 0%, #20B2AA 50%, #1A9E8F 100%);
  --primary-glow: 0 4px 30px rgba(46, 196, 182, 0.3);

  /* Accent colors */
  --accent-coral: #FF6B6B;
  --accent-amber: #FFB347;
  --accent-purple: #8B5CF6;
  --accent-blue: #3B82F6;
  --accent-emerald: #10B981;

  /* Neutral palette */
  --bg-primary: #F0F7F5;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #E8F4F2;
  --bg-dark: #0F1923;
  --text-primary: #1A2332;
  --text-secondary: #4A5568;
  --text-muted: #8896A6;
  --text-white: #FFFFFF;
  --border-color: #E2EBE8;
  --border-light: #F0F5F3;

  /* Sidebar */
  --sidebar-bg: linear-gradient(180deg, #1A2332 0%, #0F1923 100%);
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 20px rgba(46, 196, 182, 0.08);

  /* Glass */
  --glass-bg: rgba(255,255,255,0.75);
  --glass-border: rgba(255,255,255,0.3);
  --glass-blur: 12px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Layout */
  --header-height: 70px;
  --content-max-width: 1200px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a { text-decoration: none; color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* ---------- Utility Classes ---------- */
.container { max-width: var(--content-max-width); margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-full); font-family: var(--font-body);
  font-weight: 600; font-size: 0.95rem; cursor: pointer; border: none;
  transition: var(--transition); position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.15);
  transform: translateX(-100%); transition: var(--transition);
}
.btn:hover::after { transform: translateX(0); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary-gradient); color: var(--text-white);
  box-shadow: 0 4px 15px rgba(46, 196, 182, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 25px rgba(46, 196, 182, 0.45); transform: translateY(-1px); }

.btn-secondary {
  background: transparent; color: var(--primary); border: 2px solid var(--primary);
}
.btn-secondary:hover { background: var(--primary); color: var(--text-white); }

.btn-danger { background: var(--accent-coral); color: var(--text-white); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.1rem; }
.btn-icon {
  width: 42px; height: 42px; padding: 0; border-radius: 50%;
  background: var(--glass-bg); border: 1px solid var(--border-color);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-secondary); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-card); border: 1px solid var(--border-light);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.glass-card {
  background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-md);
}

.stat-card {
  background: var(--bg-secondary); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-card); position: relative;
  overflow: hidden; border: 1px solid var(--border-light);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--primary-gradient);
}
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  margin-bottom: 16px;
}
.stat-card .stat-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem;
  color: var(--text-primary);
}

.form-input {
  width: 100%; padding: 12px 16px; border: 2px solid var(--border-color);
  border-radius: var(--radius-md); font-family: var(--font-body); font-size: 0.95rem;
  background: var(--bg-secondary); color: var(--text-primary);
  transition: var(--transition); outline: none;
}
.form-input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.15);
}
.form-input::placeholder { color: var(--text-muted); }

textarea.form-input { min-height: 120px; resize: vertical; }

.form-select {
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238896A6' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  padding-right: 44px;
}

/* ---------- Layout: Sidebar + Content ---------- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width); background: var(--sidebar-bg);
  color: var(--text-white); padding: 24px 16px;
  display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; bottom: 0; z-index: 100;
  transition: var(--transition);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  margin-bottom: 36px;
}
.sidebar-logo .logo-icon {
  width: 42px; height: 42px; background: var(--primary-gradient);
  border-radius: var(--radius-md); display: flex; align-items: center;
  justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700;
}
.sidebar-logo .logo-text span { color: var(--primary-light); }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border-radius: var(--radius-md); color: rgba(255,255,255,0.6);
  font-weight: 500; font-size: 0.92rem; transition: var(--transition);
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.nav-item.active {
  background: rgba(46, 196, 182, 0.15); color: var(--primary-light);
  border-left: 3px solid var(--primary-light);
}
.nav-item i { font-size: 1.15rem; width: 24px; text-align: center; }

.sidebar-footer {
  padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: auto;
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1; margin-left: var(--sidebar-width); min-height: 100vh;
  transition: var(--transition);
}

.top-bar {
  height: var(--header-height); background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color); padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

.top-bar .page-title { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; }
.top-bar .search-box {
  display: flex; align-items: center; gap: 10px; background: var(--bg-primary);
  border-radius: var(--radius-full); padding: 8px 20px; width: 320px;
}
.top-bar .search-box input {
  border: none; background: transparent; outline: none; width: 100%;
  font-family: var(--font-body); font-size: 0.9rem;
}
.top-bar .user-actions { display: flex; align-items: center; gap: 12px; }
.top-bar .notification-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary); border: none; cursor: pointer; font-size: 1.1rem;
}
.top-bar .user-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center; color: white;
  font-weight: 700; cursor: pointer;
}

.page-content { padding: 32px; }

/* ---------- Dashboard Grid ---------- */
.dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px;
  margin-bottom: 32px;
}

.chart-section {
  display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 32px;
}

/* ---------- Progress Bar ---------- */
.progress-bar { height: 8px; background: var(--bg-tertiary); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar .progress-fill {
  height: 100%; background: var(--primary-gradient); border-radius: var(--radius-full);
  transition: width 1s ease;
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px;
  border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: #D1FAE5; color: #059669; }
.badge-warning { background: #FEF3C7; color: #D97706; }
.badge-danger { background: #FEE2E2; color: #DC2626; }
.badge-info { background: #DBEAFE; color: #2563EB; }

/* ---------- Table ---------- */
.table-container { overflow-x: auto; border-radius: var(--radius-lg); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 14px 18px; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}
.data-table td {
  padding: 14px 18px; border-bottom: 1px solid var(--border-light); font-size: 0.9rem;
}
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--bg-tertiary); }

/* ---------- Alert / Toast ---------- */
.alert {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-radius: var(--radius-md); margin-bottom: 16px; font-size: 0.9rem;
}
.alert-info { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.alert-success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert-error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px); opacity: 0;
  pointer-events: none; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-secondary); border-radius: var(--radius-xl);
  padding: 32px; max-width: 500px; width: 90%; max-height: 80vh;
  overflow-y: auto; box-shadow: var(--shadow-xl);
  transform: scale(0.9); transition: var(--transition);
}
.modal-overlay.active .modal { transform: scale(1); }

/* ---------- Loading Spinner ---------- */
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--border-color);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0; background: rgba(240, 247, 245, 0.9);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; z-index: 9999; gap: 16px;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-fade { animation: fadeIn 0.6s ease forwards; }
.animate-slide-left { animation: slideInLeft 0.5s ease forwards; }
.animate-slide-right { animation: slideInRight 0.5s ease forwards; }
.animate-scale { animation: scaleIn 0.4s ease forwards; }

/* ---------- Chatbot Styles ---------- */
.chat-container {
  display: flex; flex-direction: column; height: calc(100vh - var(--header-height) - 64px);
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 24px; display: flex;
  flex-direction: column; gap: 16px;
}
.chat-bubble {
  max-width: 70%; padding: 14px 18px; border-radius: var(--radius-lg);
  font-size: 0.92rem; line-height: 1.6; animation: fadeIn 0.3s ease;
}
.chat-bubble.user {
  background: var(--primary-gradient); color: var(--text-white);
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.chat-bubble.bot {
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  align-self: flex-start; border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.chat-input-area {
  padding: 16px 24px; border-top: 1px solid var(--border-color);
  display: flex; gap: 12px; align-items: center; background: var(--bg-secondary);
}
.chat-input-area input {
  flex: 1; padding: 14px 20px; border: 2px solid var(--border-color);
  border-radius: var(--radius-full); font-size: 0.95rem; outline: none;
  font-family: var(--font-body); transition: var(--transition);
}
.chat-input-area input:focus { border-color: var(--primary); }
.typing-indicator {
  display: flex; gap: 4px; padding: 14px 18px; align-self: flex-start;
}
.typing-indicator span {
  width: 8px; height: 8px; background: var(--text-muted); border-radius: 50%;
  animation: typing 1.4s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ---------- Diagnosis Steps ---------- */
.step-indicator {
  display: flex; align-items: center; justify-content: center; gap: 0;
  margin-bottom: 40px;
}
.step {
  display: flex; align-items: center; gap: 8px; position: relative;
}
.step-circle {
  width: 40px; height: 40px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-weight: 700;
  font-size: 0.9rem; border: 2px solid var(--border-color);
  color: var(--text-muted); transition: var(--transition);
  background: var(--bg-secondary);
}
.step.active .step-circle {
  background: var(--primary-gradient); color: var(--text-white);
  border-color: var(--primary); box-shadow: var(--primary-glow);
}
.step.completed .step-circle {
  background: var(--accent-emerald); color: var(--text-white);
  border-color: var(--accent-emerald);
}
.step-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.step.active .step-label { color: var(--primary); font-weight: 600; }
.step-connector {
  width: 60px; height: 2px; background: var(--border-color);
  margin: 0 8px;
}
.step.completed + .step-connector, .step.completed ~ .step-connector {
  background: var(--accent-emerald);
}

/* ---------- File Upload ---------- */
.file-upload-zone {
  border: 2px dashed var(--border-color); border-radius: var(--radius-lg);
  padding: 40px; text-align: center; cursor: pointer; transition: var(--transition);
  background: var(--bg-primary);
}
.file-upload-zone:hover, .file-upload-zone.dragover {
  border-color: var(--primary); background: rgba(46, 196, 182, 0.05);
}
.file-upload-zone i { font-size: 2.5rem; color: var(--primary); margin-bottom: 12px; }
.file-upload-zone p { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Results / Confidence Bars ---------- */
.confidence-bar-container { margin-bottom: 16px; }
.confidence-bar-label {
  display: flex; justify-content: space-between; margin-bottom: 6px;
  font-size: 0.9rem;
}
.confidence-bar {
  height: 12px; background: var(--bg-tertiary); border-radius: var(--radius-full);
  overflow: hidden;
}
.confidence-bar-fill {
  height: 100%; border-radius: var(--radius-full); transition: width 1.5s ease;
  background: var(--primary-gradient);
}
.confidence-bar-fill.high { background: linear-gradient(90deg, #10B981, #059669); }
.confidence-bar-fill.medium { background: linear-gradient(90deg, #FFB347, #FF8C00); }
.confidence-bar-fill.low { background: linear-gradient(90deg, #FF6B6B, #DC2626); }

/* ---------- Accordion ---------- */
.accordion-item { border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: 8px; overflow: hidden; }
.accordion-header {
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; font-weight: 600; background: var(--bg-secondary); transition: var(--transition);
}
.accordion-header:hover { background: var(--bg-tertiary); }
.accordion-header i { transition: transform 0.3s; }
.accordion-item.open .accordion-header i { transform: rotate(180deg); }
.accordion-body {
  max-height: 0; overflow: hidden; transition: max-height 0.4s ease;
  background: var(--bg-primary);
}
.accordion-item.open .accordion-body { max-height: 500px; }
.accordion-body-inner { padding: 16px 20px; }

/* ---------- Tag / Chip ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  background: var(--bg-tertiary); border-radius: var(--radius-full);
  font-size: 0.82rem; font-weight: 500; color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.tag.selected { background: rgba(46,196,182,0.15); color: var(--primary-dark); border-color: var(--primary); }
.tag .remove { cursor: pointer; font-size: 0.9rem; opacity: 0.6; }
.tag .remove:hover { opacity: 1; }

/* ---------- Quick Reply Chips ---------- */
.quick-replies { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 24px; }
.quick-reply-chip {
  padding: 8px 16px; background: var(--bg-tertiary); border: 1px solid var(--border-color);
  border-radius: var(--radius-full); font-size: 0.82rem; cursor: pointer;
  transition: var(--transition);
}
.quick-reply-chip:hover { background: rgba(46,196,182,0.1); border-color: var(--primary); color: var(--primary); }

/* ========== Landing Page Styles ========== */
.landing-page { min-height: 100vh; }

.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 48px; position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
}

.hero-section {
  min-height: 100vh; display: flex; align-items: center;
  padding: 100px 48px 60px; position: relative; overflow: hidden;
}
.hero-section::before {
  content: ''; position: absolute; top: -50%; right: -10%; width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(46,196,182,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-section::after {
  content: ''; position: absolute; bottom: -30%; left: -10%; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content { max-width: 600px; position: relative; z-index: 1; }
.hero-content h1 { font-size: 3.2rem; margin-bottom: 20px; line-height: 1.15; }
.hero-content h1 .highlight { background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-content p { font-size: 1.15rem; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; }
.hero-visual { flex: 1; display: flex; justify-content: center; position: relative; z-index: 1; }

.features-section { padding: 100px 48px; background: var(--bg-secondary); }
.features-section h2 { text-align: center; margin-bottom: 16px; }
.features-section .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 60px; font-size: 1.05rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; max-width: 1200px; margin: 0 auto; }
.feature-card { text-align: center; padding: 40px 30px; border-radius: var(--radius-xl); transition: var(--transition); }
.feature-card:hover { background: var(--bg-primary); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.feature-card .feature-icon {
  width: 70px; height: 70px; border-radius: var(--radius-lg); margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
}
.feature-card h3 { margin-bottom: 12px; }
.feature-card p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }

/* Auth Forms */
.auth-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; background: var(--bg-primary);
}
.auth-card {
  background: var(--bg-secondary); border-radius: var(--radius-xl);
  padding: 48px; max-width: 440px; width: 100%; box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
}
.auth-card h2 { text-align: center; margin-bottom: 8px; }
.auth-card .auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 32px; }
.auth-divider {
  display: flex; align-items: center; gap: 16px; margin: 24px 0;
  color: var(--text-muted); font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-color);
}
.auth-footer { text-align: center; margin-top: 24px; font-size: 0.9rem; color: var(--text-muted); }

/* ---------- Symptom Search ---------- */
.symptom-search { position: relative; margin-bottom: 20px; }
.symptom-search input { padding-left: 44px; }
.symptom-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.symptom-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-secondary);
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  max-height: 250px; overflow-y: auto; z-index: 10; box-shadow: var(--shadow-lg);
  display: none;
}
.symptom-dropdown.show { display: block; }
.symptom-dropdown-item {
  padding: 10px 16px; cursor: pointer; font-size: 0.9rem;
  transition: var(--transition);
}
.symptom-dropdown-item:hover { background: var(--bg-tertiary); }
.selected-symptoms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- Mobile Responsive ---------- */
.mobile-nav-toggle { display: none; }
.mobile-bottom-nav { display: none; }
.sidebar-overlay { display: none; }

/* ---- Tablet Breakpoint (1024px) ---- */
@media (max-width: 1024px) {
  .chart-section { grid-template-columns: 1fr; }

  /* Landing page */
  .hero-section {
    flex-direction: column; text-align: center;
    padding: 120px 24px 60px; gap: 40px;
  }
  .hero-content { max-width: 100%; }
  .hero-content h1 { font-size: 2.4rem; }
  .hero-content p { font-size: 1.05rem; }
  .hero-actions { justify-content: center; flex-wrap: wrap; }
  .hero-visual { margin-top: 0; }
  .landing-hero-illustration { width: 380px; height: 340px; }
  .central-circle { width: 140px; height: 140px; }
  .central-circle i { font-size: 3rem; }

  .features-section { padding: 80px 32px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .trust-section { padding: 32px 24px; }
  .trust-badges { gap: 24px; }
  .cta-section { padding: 60px 32px; }

  /* App layout */
  .top-bar .search-box { width: 240px; }
}

/* ---- Mobile Breakpoint (768px) ---- */
@media (max-width: 768px) {
  /* Sidebar: overlay mode */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.3);
  }

  /* Sidebar overlay backdrop */
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 199;
  }
  .sidebar-overlay.active { display: block; }

  /* Main content fills full width */
  .main-content { margin-left: 0; }

  /* Hamburger toggle */
  .mobile-nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background: var(--bg-primary);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    font-size: 1.2rem; cursor: pointer; color: var(--text-primary);
    flex-shrink: 0; transition: var(--transition);
  }
  .mobile-nav-toggle:active { transform: scale(0.95); background: var(--bg-tertiary); }

  /* Mobile bottom nav */
  .mobile-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-secondary); border-top: 1px solid var(--border-color);
    z-index: 100;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  }
  .mobile-bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 8px 4px; font-size: 0.68rem; font-weight: 500;
    color: var(--text-muted); transition: var(--transition);
    text-decoration: none; position: relative;
  }
  .mobile-bottom-nav a.active { color: var(--primary); }
  .mobile-bottom-nav a.active::before {
    content: ''; position: absolute; top: -1px; left: 25%; right: 25%;
    height: 3px; background: var(--primary-gradient); border-radius: 0 0 4px 4px;
  }
  .mobile-bottom-nav a i { font-size: 1.15rem; }

  /* Page content with bottom nav padding */
  .page-content {
    padding: 20px 16px calc(20px + 70px + env(safe-area-inset-bottom, 0px));
  }

  /* Top bar adjustments */
  .top-bar {
    padding: 0 12px; height: 60px;
    gap: 8px;
  }
  .top-bar .page-title { font-size: 1.1rem; }
  .top-bar .search-box { display: none; }
  .top-bar .user-actions { gap: 8px; }
  .top-bar .notification-btn { width: 36px; height: 36px; font-size: 0.95rem; }
  .top-bar .user-avatar { width: 36px; height: 36px; font-size: 0.85rem; }

  /* Dashboard */
  .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; margin-bottom: 10px; }

  /* LANDING PAGE */
  .landing-nav {
    padding: 12px 16px;
  }
  .landing-nav .sidebar-logo { gap: 8px; margin-bottom: 0; }
  .landing-nav .sidebar-logo .logo-icon { width: 36px; height: 36px; font-size: 1.1rem; }
  .landing-nav .sidebar-logo .logo-text { font-size: 1.05rem; }
  /* Hide desktop nav links, keep buttons */
  .landing-nav > div:last-child a:not(.btn) { display: none; }
  .landing-nav > div:last-child { gap: 8px; }

  .hero-section {
    padding: 90px 16px 40px; min-height: auto;
    gap: 32px;
  }
  .hero-content h1 { font-size: 1.85rem; line-height: 1.2; }
  .hero-content p { font-size: 0.95rem; margin-bottom: 24px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { padding: 12px 20px; font-size: 0.9rem; }

  /* Hero visual sizing */
  .landing-hero-illustration { width: 300px; height: 280px; }
  .central-circle { width: 110px; height: 110px; }
  .central-circle i { font-size: 2.5rem; }
  .floating-card { padding: 10px 14px; border-radius: 12px; }
  .floating-card .fc-icon { width: 36px; height: 36px; font-size: 1rem; }
  .floating-card .fc-text strong { font-size: 0.78rem; }
  .floating-card .fc-text span { font-size: 0.68rem; }

  .trust-section { padding: 24px 16px; }
  .trust-badges { gap: 16px; }
  .trust-badge { font-size: 0.78rem; gap: 6px; }
  .trust-badge i { font-size: 1.1rem; }

  .features-section { padding: 48px 16px; }
  .features-section h2 { font-size: 1.5rem; }
  .features-section .subtitle { font-size: 0.9rem; margin-bottom: 36px; }
  .features-grid { grid-template-columns: 1fr; gap: 16px; }
  .feature-card { padding: 28px 20px; }
  .feature-card .feature-icon { width: 56px; height: 56px; font-size: 1.4rem; }
  .feature-card h3 { font-size: 1.15rem; }
  .feature-card p { font-size: 0.85rem; }

  .cta-section { padding: 48px 16px; }
  .cta-section h2 { font-size: 1.5rem; }
  .cta-section p { font-size: 0.9rem; }

  .landing-footer { padding: 24px 16px; font-size: 0.78rem; }

  /* Auth modal/overlay */
  .auth-overlay .auth-panel {
    width: 94%; max-width: 400px; padding: 28px 20px;
    border-radius: 20px; max-height: 90vh; overflow-y: auto;
  }
  .auth-tabs .auth-tab { padding: 10px; font-size: 0.88rem; }
  .auth-card { padding: 24px 16px; }

  /* Forms — bigger touch targets */
  .form-input {
    padding: 14px 16px; font-size: 1rem;
    border-radius: var(--radius-md);
    min-height: 48px;
  }
  .form-label { font-size: 0.88rem; margin-bottom: 6px; }
  .btn { padding: 14px 24px; font-size: 0.95rem; min-height: 48px; }
  .btn-sm { padding: 10px 16px; font-size: 0.85rem; min-height: 40px; }
  .btn-lg { padding: 16px 28px; font-size: 1rem; }

  /* Cards */
  .card { padding: 16px; border-radius: var(--radius-md); }

  /* Chatbot */
  .chat-container { height: calc(100vh - 60px - 70px - env(safe-area-inset-bottom, 0px)); }
  .chat-messages { padding: 16px 12px; gap: 12px; }
  .chat-bubble { max-width: 88%; padding: 12px 14px; font-size: 0.88rem; }
  .chat-input-area { padding: 10px 12px; gap: 8px; }
  .chat-input-area input {
    padding: 12px 16px; font-size: 0.95rem;
    border-radius: var(--radius-full);
  }
  .chat-input-area .btn { width: 44px; height: 44px; }
  .quick-replies { padding: 8px 12px; gap: 6px; }
  .quick-reply-chip { padding: 8px 12px; font-size: 0.78rem; }
  .chat-header-info .bot-avatar { width: 32px; height: 32px; font-size: 0.8rem; }
  .bot-msg-wrapper .mini-avatar { width: 24px; height: 24px; font-size: 0.6rem; }

  /* Diagnosis steps */
  .step-label { display: none; }
  .step-connector { width: 30px; }
  .progress-steps { gap: 0; margin-bottom: 24px; }
  .p-step-dot { width: 32px; height: 32px; font-size: 0.8rem; }
  .p-step-line { width: 24px; margin: 0 2px; }
  .p-step-name { font-size: 0.6rem; max-width: 50px; }
  .nav-buttons { flex-direction: column; gap: 12px; }
  .nav-buttons .btn { width: 100%; justify-content: center; }

  /* Symptom detail cards */
  .symptom-detail-card { padding: 12px; }
  .checkbox-group { gap: 8px; }
  .checkbox-label { padding: 8px 12px; font-size: 0.82rem; }
  .radio-pills { gap: 6px; }
  .radio-pill { padding: 8px 14px; font-size: 0.82rem; }

  /* Tables */
  .table-container { margin: 0 -16px; border-radius: 0; }
  .data-table th { padding: 10px 12px; font-size: 0.72rem; white-space: nowrap; }
  .data-table td { padding: 10px 12px; font-size: 0.82rem; }

  /* Results page */
  .info-grid { grid-template-columns: 1fr; gap: 10px; }
  .summary-box { padding: 16px; font-size: 0.9rem; }
  .confidence-bar-label { font-size: 0.82rem; }
  .test-list { gap: 6px; }
  .test-item { font-size: 0.78rem; padding: 5px 10px; }

  /* History */
  .data-table td:nth-child(5) { display: none; }

  /* Modals */
  .modal { padding: 24px 16px; width: 94%; border-radius: 20px; }

  /* Alerts */
  .alert { padding: 12px 14px; font-size: 0.85rem; gap: 10px; }

  /* Tags */
  .tag { padding: 5px 10px; font-size: 0.78rem; }

  /* Badges */
  .badge { font-size: 0.7rem; padding: 3px 8px; }

  /* Welcome banner on dashboard */
  .card[style*="primary-gradient"] h2 { font-size: 1.3rem !important; }
  .card[style*="primary-gradient"] p { font-size: 0.88rem !important; }
  .card[style*="primary-gradient"] .flex.gap-2 {
    flex-direction: column; width: 100%;
  }
  .card[style*="primary-gradient"] .flex.gap-2 .btn {
    width: 100%; text-align: center; justify-content: center;
  }

  /* Accordion */
  .accordion-header { padding: 12px 14px; font-size: 0.9rem; }
  .accordion-body-inner { padding: 12px 14px; font-size: 0.88rem; }

  /* Severity slider */
  .severity-slider { height: 8px; }
  .severity-labels { font-size: 0.7rem; }

  /* File upload */
  .file-upload-zone { padding: 28px 16px; }
  .file-upload-zone i { font-size: 2rem; }
  .file-upload-zone p { font-size: 0.82rem; }
}

/* ---- Small phone breakpoint (480px) ---- */
@media (max-width: 480px) {
  .hero-content h1 { font-size: 1.6rem; }
  .hero-content p { font-size: 0.88rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .landing-hero-illustration { width: 260px; height: 240px; }
  .central-circle { width: 90px; height: 90px; }
  .central-circle i { font-size: 2rem; }
  .floating-card .fc-text strong { font-size: 0.72rem; }
  .floating-card .fc-text span { font-size: 0.62rem; }
  .floating-card .fc-icon { width: 30px; height: 30px; font-size: 0.85rem; }
  .floating-card { padding: 8px 10px; gap: 8px; }

  .dashboard-grid { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 1.3rem; }

  .features-section h2 { font-size: 1.3rem; }

  .auth-overlay .auth-panel { width: 96%; padding: 24px 16px; }

  .top-bar .page-title { font-size: 0.95rem; }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.15rem; }
  h4 { font-size: 1.05rem; }

  .chat-bubble { max-width: 92%; }

  /* Full width buttons on very small screens */
  .result-section .flex.gap-2 { flex-direction: column; }
  .result-section .flex.gap-2 .btn { width: 100%; justify-content: center; }
}

/* ---- Landscape phone fix ---- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section { min-height: auto; padding-top: 80px; }
  .chat-container { height: calc(100vh - 50px); }
  .mobile-bottom-nav { padding: 4px 0; }
  .mobile-bottom-nav a { padding: 4px; font-size: 0.65rem; }
  .mobile-bottom-nav a i { font-size: 1rem; }
}

/* ---- Safe area insets for notched devices (iPhone X+, etc.) ---- */
@supports (padding: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
  }
  .page-content {
    padding-bottom: calc(20px + 70px + env(safe-area-inset-bottom));
  }
}

/* ---- Touch device improvements ---- */
@media (hover: none) and (pointer: coarse) {
  .btn:hover::after { transform: translateX(-100%); }
  .btn:hover { transform: none; }
  .btn-primary:hover { transform: none; }
  .card:hover { transform: none; box-shadow: var(--shadow-card); }
  .feature-card:hover { transform: none; }
  .nav-item:active { background: rgba(255,255,255,0.12); }
  .btn:active { transform: scale(0.97); }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Hide scrollbar on mobile for cleaner look */
@media (max-width: 768px) {
  ::-webkit-scrollbar { width: 0px; }
}

/* ---------- Dark mode preparation (optional) ---------- */
.dark-mode {
  --bg-primary: #0F1923;
  --bg-secondary: #1A2332;
  --bg-tertiary: #243447;
  --text-primary: #E2EBE8;
  --text-secondary: #A0AEC0;
  --text-muted: #718096;
  --border-color: #2D3748;
  --border-light: #243447;
}

/* ---------- Print styles ---------- */
@media print {
  .sidebar, .mobile-bottom-nav, .top-bar, .mobile-nav-toggle { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}
