/* ====================================
   TAHLILATIY - Medical Analysis Web App
   Complete CSS Stylesheet (Dark Theme)
   ==================================== */

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

:root {
  /* Primary Colors */
  --primary: #00a651;
  --primary-dark: #006837;
  --primary-light: #22c55e;
  --secondary: #3399ff;
  --accent: #ffd700;

  /* Status Colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;

  /* Background Colors */
  --background: #000000;
  --background-secondary: #111111;
  --background-tertiary: #1a1a1a;
  --background-card: #1e1e1e;
  --background-elevated: #2a2a2a;

  /* Text Colors */
  --text: #ffffff;
  --text-muted: #e0e0e0;
  --text-light: #f0f0f0;
  --text-secondary: #c0c0c0;

  /* Border Colors */
  --border: #333333;
  --border-light: #404040;
  --border-lighter: #4a4a4a;

  /* Shadows */
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-primary: 0 8px 25px rgba(0, 166, 81, 0.3);

  /* Glass Effect */
  --glass-bg: rgba(26, 26, 26, 0.9);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-backdrop: blur(20px);

  /* Layout */
  --header-height: 70px;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: 0.3s ease;

  /* Font */
  --font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Light Theme */
[data-theme="light"] {
  --primary: #008a43;
  --primary-dark: #005a2b;
  --primary-light: #16a34a;
  --secondary: #2563eb;
  --accent: #b8860b;

  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;

  --background: #f8fafc;
  --background-secondary: #f1f5f9;
  --background-tertiary: #e2e8f0;
  --background-card: #ffffff;
  --background-elevated: #f1f5f9;

  --text: #1e293b;
  --text-muted: #475569;
  --text-light: #334155;
  --text-secondary: #64748b;

  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --border-lighter: #94a3b8;

  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-primary: 0 8px 25px rgba(0, 138, 67, 0.15);

  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-backdrop: blur(20px);
}

[data-theme="light"] body {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
}

[data-theme="light"] body::before {
  background: radial-gradient(circle at 20% 50%, rgba(0, 138, 67, 0.04) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(37, 99, 235, 0.03) 0%, transparent 50%);
}

[data-theme="light"] .main-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 138, 67, 0.15);
}

[data-theme="light"] .lang-switcher {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .lang-btn {
  color: var(--text-secondary);
}

[data-theme="light"] .lang-btn.active {
  background: var(--primary);
  color: #ffffff;
}

[data-theme="light"] .upload-zone {
  background: rgba(0, 138, 67, 0.03);
  border-color: var(--border);
}

[data-theme="light"] .upload-zone:hover,
[data-theme="light"] .upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(0, 138, 67, 0.06);
}

[data-theme="light"] .test-chip {
  background: rgba(0, 138, 67, 0.1);
  color: var(--primary-dark);
  border-color: rgba(0, 138, 67, 0.2);
}

[data-theme="light"] .tag-normal {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

[data-theme="light"] .tag-high {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

[data-theme="light"] .tag-low {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

[data-theme="light"] .test-function {
  background: rgba(2, 132, 199, 0.06);
  color: var(--text-muted);
}

[data-theme="light"] .test-interpretation {
  background: rgba(0, 138, 67, 0.04);
  color: var(--text-muted);
}

[data-theme="light"] .summary-good {
  background: rgba(22, 163, 74, 0.06);
  border-color: rgba(22, 163, 74, 0.2);
}

[data-theme="light"] .summary-bad {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.2);
}

[data-theme="light"] .summary-danger {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.2);
}

[data-theme="light"] .med-card-icon {
  background: rgba(2, 132, 199, 0.1);
}

[data-theme="light"] .med-card-warning {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.15);
}

[data-theme="light"] .modal {
  background: var(--background-card);
  border-color: var(--border);
}

[data-theme="light"] .modal-overlay {
  background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .disclaimer-section {
  background: rgba(0, 138, 67, 0.04);
  border-color: rgba(0, 138, 67, 0.15);
}

[data-theme="light"] .symptom-card {
  background: rgba(245, 158, 11, 0.04);
  border-color: rgba(245, 158, 11, 0.15);
}

[data-theme="light"] .results-content tr:nth-child(even),
[data-theme="light"] .test-card tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .results-content th,
[data-theme="light"] .test-card th {
  background: rgba(0, 138, 67, 0.08);
  color: var(--primary-dark);
}

[data-theme="light"] .mode-tab {
  color: var(--text-secondary);
}

[data-theme="light"] .mode-tab.active {
  background: var(--primary);
  color: #ffffff;
}

[data-theme="light"] .history-item {
  background: var(--background-card);
  border-color: var(--border);
}

[data-theme="light"] .btn-outline {
  border-color: var(--border);
  color: var(--text);
}

[data-theme="light"] .search-bar {
  background: var(--background-card);
  border-color: var(--border);
}

[data-theme="light"] .copy-toast {
  background: var(--background-card);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

/* Theme Toggle Button */
.btn-theme {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 38px;
  height: 38px;
}

.btn-theme:hover {
  color: var(--primary);
  background: rgba(0, 166, 81, 0.1);
}

.btn-theme svg {
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.btn-theme .icon-sun {
  display: none;
}

.btn-theme .icon-moon {
  display: block;
}

[data-theme="light"] .btn-theme .icon-sun {
  display: block;
}

[data-theme="light"] .btn-theme .icon-moon {
  display: none;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--background) 0%, var(--background-secondary) 50%, var(--background) 100%);
  color: var(--text);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(0, 166, 81, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(51, 153, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: backgroundFloat 20s ease-in-out infinite;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  padding-top: var(--header-height);
  position: relative;
  z-index: 1;
}

/* ====================================
   ANIMATIONS
   ==================================== */

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

@keyframes backgroundFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(1deg);
  }
}

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

/* ====================================
   HEADER
   ==================================== */

.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid rgba(0, 166, 81, 0.2);
  z-index: 998;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 2rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 800;
}

.logo-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 166, 81, 0.2);
  border-radius: 8px;
  color: var(--accent);
  font-size: 1.4rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  font-family: inherit;
  font-size: 1.2rem;
}

.btn-icon:hover {
  color: var(--primary);
  background: rgba(0, 166, 81, 0.1);
}

/* ====================================
   LANGUAGE SWITCHER
   ==================================== */

.lang-switcher {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 3px;
}

.lang-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
  font-family: inherit;
}

.lang-btn.active {
  background: var(--primary);
  color: white;
}

.lang-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
}

/* ====================================
   HERO SECTION
   ==================================== */

.hero {
  padding: 120px 0 40px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(0, 166, 81, 0.15);
  color: var(--primary-light);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(0, 166, 81, 0.3);
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
  animation: fadeInUp 0.8s ease 0.1s backwards;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
  animation: fadeInUp 1s ease 0.2s backwards;
}

/* ====================================
   UPLOAD SECTION
   ==================================== */

.upload-section {
  padding: 0 0 40px;
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 4px;
  margin-bottom: 16px;
}

.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.mode-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.mode-tab.active {
  background: rgba(0, 166, 81, 0.15);
  color: var(--primary);
  border: 1px solid rgba(0, 166, 81, 0.3);
}

.meds-upload-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  color: var(--info);
  font-size: 0.85rem;
  line-height: 1.6;
}

.meds-upload-hint svg {
  flex-shrink: 0;
}

/* Medicine Card Styles */
.med-card {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition);
  border-left: 4px solid var(--info);
}

html[dir="rtl"] .med-card {
  border-left: none;
  border-right: 4px solid var(--info);
}

.med-card:hover {
  border-color: rgba(14, 165, 233, 0.4);
}

html[dir="rtl"] .med-card:hover {
  border-right-color: rgba(14, 165, 233, 0.4);
}

.med-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.med-card-icon {
  width: 36px;
  height: 36px;
  background: rgba(14, 165, 233, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--info);
  flex-shrink: 0;
}

.med-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.med-card-unknown {
  border-left-color: var(--text-secondary);
}

html[dir="rtl"] .med-card-unknown {
  border-right-color: var(--text-secondary);
}

.med-card-field {
  margin-bottom: 10px;
}

.med-card-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.med-card-field-value {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.med-card-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border-radius: var(--border-radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--glass-border);
  animation: fadeInUp 1s ease 0.3s backwards;
}

.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--border-radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(0, 166, 81, 0.1);
}

.upload-icon {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: 3rem;
  transition: var(--transition);
}

.upload-zone:hover .upload-icon {
  color: var(--primary);
  transform: translateY(-4px);
}

.upload-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.upload-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.preview-area {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.preview-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.preview-remove:hover {
  background: #d32f2f;
  transform: scale(1.1);
}

/* ====================================
   BUTTONS
   ==================================== */

.btn-link {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
  font-family: inherit;
}

.btn-link:hover {
  opacity: 0.8;
}

.btn-primary {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 166, 81, 0.1);
}

.btn-whatsapp {
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  border-color: #25d366;
  color: #25d366;
  background: rgba(37, 211, 102, 0.1);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  font-family: inherit;
  font-size: 1.2rem;
}

.btn-icon:hover {
  color: var(--primary);
  background: rgba(0, 166, 81, 0.1);
}

/* ====================================
   LOADING SECTION
   ==================================== */

.loading-section {
  padding: 100px 0;
}

.loading-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 48px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.loader-ring {
  width: 56px;
  height: 56px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 1s linear infinite;
}

.loading-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.loading-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.timer-wrapper {
  margin-bottom: 20px;
}

.timer-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(0, 166, 81, 0.15);
  border-radius: 100px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.timer-icon {
  display: flex;
  align-items: center;
  color: var(--primary);
}

.timer-remaining {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.timer-remaining span {
  color: var(--accent);
  font-weight: 800;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s;
}

.loading-tip {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ====================================
   RESULTS SECTION
   ==================================== */

.results-section {
  padding: 100px 0 40px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.results-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Status Grid */

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.status-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.status-icon.info {
  background: rgba(14, 165, 233, 0.15);
  color: var(--info);
}

.status-icon.success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.status-icon.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.status-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.status-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.status-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

/* Results Content */

.results-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.results-content h2,
.results-content h3 {
  color: var(--primary);
  margin: 24px 0 12px;
  font-weight: 700;
}

.results-content h2:first-child,
.results-content h3:first-child {
  margin-top: 0;
}

.results-content p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 10px;
}

.results-content ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.results-content li {
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.6;
}

.results-content strong {
  color: var(--text);
}

/* Tests List */

.tests-list-section {
  margin-bottom: 24px;
}

.tests-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.test-chip {
  background: rgba(0, 166, 81, 0.15);
  color: var(--primary-light);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(0, 166, 81, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-chip:hover {
  background: rgba(0, 166, 81, 0.3);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 166, 81, 0.2);
}

/* Test Cards */

.test-card {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.test-card:hover {
  border-color: rgba(0, 166, 81, 0.3);
}

.test-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.test-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.test-function {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--info);
  line-height: 1.6;
  font-family: 'Courier New', monospace;
}

.test-interpretation {
  background: rgba(255, 255, 255, 0.03);
  border-right: 3px solid var(--primary);
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  border-radius: 0 8px 8px 0;
}

/* Status Tags */

.tag-normal {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
}

.tag-high {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
}

.tag-low {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
}

/* Tables */

.results-content table,
.test-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.85rem;
}

.results-content th,
.test-card th {
  background: rgba(0, 166, 81, 0.15);
  color: var(--primary-light);
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  border: 1px solid var(--border);
}

.results-content td,
.test-card td {
  padding: 10px 12px;
  text-align: center;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.results-content tr:nth-child(even),
.test-card tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.results-content table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.test-card table {
  display: block;
  overflow-x: auto;
}

/* Summary Section */

.summary-section {
  margin: 24px 0;
}

.summary-good {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--border-radius);
  padding: 16px;
  margin-bottom: 12px;
}

.summary-good h3 {
  color: var(--success) !important;
  margin: 0 0 8px !important;
}

.summary-bad {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--border-radius);
  padding: 16px;
  margin-bottom: 12px;
}

.summary-bad h3 {
  color: var(--warning) !important;
  margin: 0 0 8px !important;
}

.summary-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--border-radius);
  padding: 16px;
}

.summary-danger h3 {
  color: var(--danger) !important;
  margin: 0 0 8px !important;
}

/* ====================================
   SYMPTOMS SECTION
   ==================================== */

.symptoms-wrapper {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.symptoms-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.symptoms-section h2 {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}

.symptom-card {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 14px;
  transition: var(--transition);
  border-left: 4px solid var(--warning);
}

html[dir="rtl"] .symptom-card {
  border-left: none;
  border-right: 4px solid var(--warning);
}

.symptom-card:hover {
  border-color: var(--accent);
  background: rgba(255, 215, 0, 0.03);
}

html[dir="rtl"] .symptom-card:hover {
  border-right-color: var(--accent);
}

.symptom-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.symptom-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.symptom-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.symptom-cause {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--warning);
  line-height: 1.6;
}

.symptom-solutions {
  padding: 0;
}

.symptom-solutions h4 {
  color: var(--primary-light);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.symptom-solutions ul {
  padding-left: 20px;
  margin: 0;
}

html[dir="rtl"] .symptom-solutions ul {
  padding-left: 0;
  padding-right: 20px;
}

.symptom-solutions li {
  color: var(--text-muted);
  margin-bottom: 5px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.symptoms-positive {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  color: var(--success);
  font-weight: 600;
  font-size: 1rem;
}

/* ====================================
   CONTACT & ADVICE SECTIONS
   ==================================== */

.contact-section,
.advice-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.contact-title,
.advice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.contact-cards {
  display: grid;
  gap: 16px;
}

.contact-card {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 16px;
}

.contact-card h4 {
  color: var(--primary);
  margin-bottom: 10px;
  font-weight: 700;
  margin: 0 0 10px;
}

.contact-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.contact-detail strong {
  color: var(--text-secondary);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid;
  font-family: inherit;
}

.btn-whatsapp {
  background: rgba(37, 211, 102, 0.15);
  color: #25D366;
  border-color: rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  background: rgba(37, 211, 102, 0.25);
}

.btn-sms {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}

.btn-sms:hover {
  background: rgba(59, 130, 246, 0.25);
}

.btn-call {
  background: rgba(0, 166, 81, 0.15);
  color: var(--primary);
  border-color: rgba(0, 166, 81, 0.3);
}

.btn-call:hover {
  background: rgba(0, 166, 81, 0.25);
}

.btn-email {
  background: rgba(234, 67, 53, 0.15);
  color: #ea4335;
  border-color: rgba(234, 67, 53, 0.3);
}

.btn-email:hover {
  background: rgba(234, 67, 53, 0.25);
}

.advice-content {
  color: var(--text-muted);
  line-height: 1.7;
}

.advice-content h2,
.advice-content h3 {
  color: var(--primary);
}

.advice-content strong {
  color: var(--text);
}

/* ====================================
   SETTINGS MODAL
   ==================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

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

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-family: inherit;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.setting-group {
  margin-bottom: 20px;
}

.setting-label {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: block;
  color: var(--text);
}

.setting-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.toggle-group {
  display: flex;
  gap: 8px;
}

.toggle-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.toggle-btn.active {
  background: rgba(0, 166, 81, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.toggle-btn:hover:not(.active) {
  border-color: var(--border-lighter);
  background: rgba(255, 255, 255, 0.05);
}

.setting-textarea,
.setting-input,
.setting-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
}

.setting-textarea:focus,
.setting-input:focus,
.setting-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.2);
}

.setting-select option {
  background: var(--background-card);
  color: var(--text);
}

/* ====================================
   DISCLAIMER SECTION
   ==================================== */

.disclaimer-section {
  padding: 0 0 24px;
}

.disclaimer-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--border-radius-lg);
  padding: 20px 24px;
  animation: fadeInUp 1.2s ease 0.3s backwards;
}

.disclaimer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--warning);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
}

.disclaimer-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.disclaimer-col h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.disclaimer-allowed h4 {
  color: var(--success);
}

.disclaimer-forbidden h4 {
  color: var(--danger);
}

.disclaimer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.disclaimer-col li {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 4px 0;
  padding-right: 16px;
  position: relative;
}

html[dir="ltr"] .disclaimer-col li {
  padding-right: 0;
  padding-left: 16px;
}

.disclaimer-allowed li::before {
  content: '';
  position: absolute;
  right: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

html[dir="ltr"] .disclaimer-allowed li::before {
  right: auto;
  left: 0;
}

.disclaimer-forbidden li::before {
  content: '';
  position: absolute;
  right: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}

html[dir="ltr"] .disclaimer-forbidden li::before {
  right: auto;
  left: 0;
}

@media (max-width: 600px) {
  .disclaimer-body {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ====================================
   SEARCH BAR
   ==================================== */

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 10px 16px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.15);
}

.search-bar svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

.search-clear {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition);
  font-family: inherit;
}

.search-clear:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* ====================================
   HISTORY SECTION
   ==================================== */

.history-section {
  padding: 0 0 24px;
}

.history-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border-radius: var(--border-radius-lg);
  padding: 20px 24px;
  border: 1px solid var(--glass-border);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

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

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.history-item:hover {
  border-color: rgba(0, 166, 81, 0.3);
  background: rgba(0, 166, 81, 0.05);
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.history-item-preview {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-tags {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.history-item-tags .tag-normal,
.history-item-tags .tag-high,
.history-item-tags .tag-low {
  font-size: 0.7rem;
  padding: 2px 7px;
}

.history-item-delete {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
  flex-shrink: 0;
  font-family: inherit;
}

.history-item-delete:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* ====================================
   COPY TOAST
   ==================================== */

.copy-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary);
  color: white;
  padding: 10px 24px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 9999;
  transition: transform 0.3s ease;
  pointer-events: none;
  font-family: var(--font-family);
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ====================================
   FOOTER
   ==================================== */

.main-footer {
  background: rgba(0, 0, 0, 0.9);
  padding: 24px 0;
  border-top: 1px solid rgba(0, 166, 81, 0.2);
  text-align: center;
  margin-top: 40px;
}

.footer-inner p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.footer-disclaimer {
  font-size: 0.75rem !important;
  color: var(--text-secondary) !important;
}

.footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-sep {
  color: var(--border-light);
  font-size: 0.8rem;
}

/* ====================================
   LEGAL PAGES
   ==================================== */

.legal-page {
  padding: 40px 0 60px;
}

.legal-title {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.legal-updated {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.legal-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 16px;
}

.legal-section.legal-warning {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.legal-section h2 {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.legal-section h3 {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 16px 0 8px;
}

.legal-section p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.legal-section ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

html[dir="rtl"] .legal-section ul {
  padding-left: 0;
  padding-right: 20px;
}

.legal-section li {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.legal-section strong {
  color: var(--text);
}

.legal-warning h2 {
  color: var(--danger) !important;
}

.legal-back {
  margin-top: 32px;
}

/* ====================================
   PRINT STYLES
   ==================================== */

@media print {
  body {
    background: white !important;
    color: black !important;
  }

  body::before {
    display: none;
  }

  .main-header,
  .upload-section,
  .loading-section,
  .btn-outline,
  .contact-actions,
  .main-footer,
  .lang-switcher,
  .search-bar,
  .copy-toast,
  .history-section {
    display: none !important;
  }

  .results-section {
    padding-top: 0 !important;
  }

  .results-content,
  .symptoms-wrapper,
  .contact-section,
  .advice-section {
    background: white !important;
    border-color: #ddd !important;
    color: black !important;
  }

  .results-content *,
  .symptoms-wrapper *,
  .contact-section *,
  .advice-section * {
    color: black !important;
  }

  .symptom-card {
    border-color: #ccc !important;
  }

  .tag-normal,
  .tag-high,
  .tag-low {
    color: black !important;
    border: 1px solid #999;
  }
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-actions .btn-outline {
    padding: 8px 10px;
    font-size: 0.78rem;
    gap: 4px;
  }

  .btn-whatsapp span {
    display: none;
  }

  .btn-whatsapp {
    padding: 8px;
  }

  .status-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .upload-card,
  .results-content,
  .loading-card,
  .contact-section,
  .advice-section {
    padding: 16px;
  }

  .lang-switcher {
    gap: 2px;
  }

  .lang-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .header-content {
    padding: 0 1rem;
  }

  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }

  .modal {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .mode-tab {
    font-size: 0.78rem;
    padding: 10px 8px;
    gap: 4px;
  }

  .mode-tab svg {
    width: 14px;
    height: 14px;
  }

  .status-grid {
    grid-template-columns: 1fr 1fr;
  }

  .container {
    padding: 0 0.75rem;
  }

  .hero {
    padding: 80px 0 30px;
  }

  .hero-title {
    font-size: clamp(1.3rem, 5vw, 2rem);
  }

  .header-content {
    padding: 0 0.75rem;
  }

  .results-header {
    gap: 8px;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .upload-zone {
    padding: 30px 15px;
  }

  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
  }

  .test-card {
    padding: 16px;
  }

  .modal {
    max-width: 95%;
  }
}

/* ====================================
   RTL/LTR SUPPORT
   ==================================== */

html[dir="rtl"] .test-interpretation {
  border-right: none;
  border-left: 3px solid var(--primary);
  border-radius: 8px 0 0 8px;
}

html[dir="rtl"] .results-content ul {
  padding-right: 0;
  padding-left: 20px;
}

html[dir="ltr"] .test-interpretation {
  border-right: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
}

html[dir="ltr"] .results-content ul {
  padding-right: 20px;
  padding-left: 0;
}

/* ====================================
   UTILITY CLASSES
   ==================================== */

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* ====================================
   ENCYCLOPEDIA PAGE
   ==================================== */

.enc-hero {
  text-align: center;
  padding: 40px 0 30px;
}

.enc-hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: rgba(0, 166, 81, 0.15);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.enc-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.enc-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.enc-search-wrapper {
  margin-bottom: 20px;
}

.enc-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 12px 16px;
  transition: var(--transition);
}

.enc-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
}

.enc-search svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.enc-search input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.enc-search input::placeholder {
  color: var(--text-secondary);
}

.enc-search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--background-elevated);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.enc-search-clear:hover {
  background: var(--danger);
  color: #fff;
}

.enc-results-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
  padding-right: 4px;
}

.enc-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.enc-cat-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--background-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.enc-cat-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.enc-cat-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.enc-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 30px;
}

.enc-card {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 20px 24px;
  transition: var(--transition);
}

.enc-card:hover {
  border-color: rgba(0, 166, 81, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.enc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.enc-card-title {
  flex: 1;
}

.enc-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.enc-card-en {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.enc-card-cat {
  font-size: 0.72rem;
  background: rgba(0, 166, 81, 0.12);
  color: var(--primary-light);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.enc-card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 14px;
}

.enc-card-ranges {
  margin-bottom: 14px;
}

.enc-card-ranges table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.enc-card-ranges th {
  background: rgba(0, 166, 81, 0.1);
  color: var(--primary-light);
  padding: 8px 10px;
  text-align: center;
  font-weight: 700;
  border: 1px solid var(--border);
}

.enc-card-ranges td {
  padding: 8px 10px;
  text-align: center;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

.enc-card-meanings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.enc-meaning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.enc-meaning-high {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.enc-meaning-low {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.enc-meaning-label {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.enc-meaning-high .enc-meaning-label {
  color: var(--danger);
}

.enc-meaning-low .enc-meaning-label {
  color: var(--info);
}

.enc-meaning-text {
  color: var(--text-muted);
  line-height: 1.5;
}

/* ====================================
   AI TERM CARD
   ==================================== */
.ai-term-card {
  margin: 24px 0;
  background: var(--background-card);
  border: 2px solid var(--primary);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.ai-term-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(0, 166, 81, 0.1), rgba(0, 166, 81, 0.05));
  border-bottom: 1px solid var(--border);
}

.ai-term-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.ai-term-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--background-elevated);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.ai-term-close:hover {
  background: var(--border);
  color: var(--text);
}

.ai-term-body {
  padding: 24px;
}

.ai-term-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.ai-term-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.ai-term-en {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
}

.ai-term-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.ai-term-tips {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(0, 166, 81, 0.08);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.6;
}

.ai-term-tips svg {
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 2px;
}

.ai-term-error {
  text-align: center;
  color: var(--danger);
  font-size: 0.85rem;
  padding: 16px 0;
}

.enc-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 20px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--border-radius);
  margin-bottom: 40px;
}

.enc-disclaimer svg {
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 2px;
}

.enc-disclaimer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.enc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.enc-empty p {
  font-size: 1rem;
}

/* Light theme overrides for encyclopedia */
[data-theme="light"] .enc-card-cat {
  background: rgba(0, 138, 67, 0.08);
  color: var(--primary-dark);
}

[data-theme="light"] .enc-meaning-high {
  background: rgba(220, 38, 38, 0.05);
  border-color: rgba(220, 38, 38, 0.12);
}

[data-theme="light"] .enc-meaning-low {
  background: rgba(2, 132, 199, 0.05);
  border-color: rgba(2, 132, 199, 0.12);
}

[data-theme="light"] .enc-card-ranges th {
  background: rgba(0, 138, 67, 0.06);
  color: var(--primary-dark);
}

/* ====================================
   SEARCH NAVIGATION (Results Page)
   ==================================== */

.search-nav {
  display: none;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.search-nav.visible {
  display: flex;
}

.search-nav-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 50px;
  text-align: center;
}

.search-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--background-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.search-nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 166, 81, 0.1);
}

.search-highlight {
  background: rgba(0, 166, 81, 0.3);
  color: var(--text);
  border-radius: 3px;
  padding: 0 2px;
}

.search-highlight.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 166, 81, 0.3);
}

[data-theme="light"] .search-highlight {
  background: rgba(0, 138, 67, 0.2);
  color: var(--text);
}

[data-theme="light"] .search-highlight.active {
  background: var(--primary);
  color: #ffffff;
}

@media (max-width: 600px) {
  .enc-card {
    padding: 16px;
  }

  .enc-card-header {
    flex-direction: column;
    gap: 6px;
  }

  .enc-meaning {
    flex-direction: column;
    gap: 4px;
  }

  .enc-categories {
    gap: 6px;
  }

  .enc-cat-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .search-nav-count {
    display: none;
  }
}

/* ====================================
   AI CHAT SECTION
   ==================================== */

.chat-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 166, 81, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-header-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.chat-header-row-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.chat-lang-switcher {
  display: flex;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.chat-lang-btn {
  padding: 5px 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.chat-lang-btn.active {
  background: var(--primary);
  color: white;
}

.chat-lang-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.btn-chat-clear {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
  font-family: inherit;
}

.btn-chat-clear:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
}

.btn-chat-action {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(0, 166, 81, 0.08);
  border: 1px solid rgba(0, 166, 81, 0.2);
  border-radius: 8px;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
  font-family: inherit;
}

.btn-chat-action:hover {
  background: rgba(0, 166, 81, 0.15);
  border-color: var(--primary);
}

.chat-messages {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 200px;
  max-height: 420px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-messages:empty::after {
  content: attr(data-placeholder);
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  margin: auto;
  padding: 20px;
}

.chat-msg {
  display: flex;
  gap: 10px;
  animation: fadeInUp 0.25s ease;
}

.chat-msg-user {
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-msg-ai .chat-msg-avatar {
  background: rgba(0, 166, 81, 0.15);
  color: var(--primary);
}

.chat-msg-user .chat-msg-avatar {
  background: rgba(51, 153, 255, 0.15);
  color: var(--secondary);
}

.chat-msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.65;
}

.chat-msg-ai .chat-msg-bubble {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px;
  color: var(--text-muted);
}

.chat-msg-user .chat-msg-bubble {
  background: rgba(0, 166, 81, 0.12);
  border: 1px solid rgba(0, 166, 81, 0.2);
  border-radius: 16px 4px 16px 16px;
  color: var(--text);
}

html[dir="ltr"] .chat-msg-ai .chat-msg-bubble {
  border-radius: 16px 4px 16px 16px;
}

html[dir="ltr"] .chat-msg-user .chat-msg-bubble {
  border-radius: 4px 16px 16px 16px;
}

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

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

.chat-msg-bubble strong {
  color: var(--text);
}

.chat-msg-bubble ul,
.chat-msg-bubble ol {
  padding-inline-start: 20px;
  margin-bottom: 8px;
}

.chat-msg-bubble li {
  margin-bottom: 4px;
}

.chat-msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.chat-msg-images img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
}

.chat-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: typingBounce 1.2s infinite;
}

.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-area {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.03);
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.btn-chat-image {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  position: relative;
}

.btn-chat-image:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(0, 166, 81, 0.08);
}

.chat-textarea {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  padding: 10px 14px;
  resize: none;
  outline: none;
  transition: var(--transition);
  min-height: 42px;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.5;
}

.chat-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.15);
}

.chat-textarea::placeholder {
  color: var(--text-secondary);
}

.btn-chat-send {
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-chat-send:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chat-image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chat-img-thumb {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-img-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: inherit;
}

.chat-ready-msg {
  background: rgba(0, 166, 81, 0.06);
  border: 1px solid rgba(0, 166, 81, 0.15);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--primary);
  font-size: 0.9rem;
  text-align: center;
  font-weight: 600;
  margin-bottom: 6px;
}

[data-theme="light"] .chat-lang-switcher {
  background: rgba(0,0,0,0.04);
}

.chat-custom-lang-input {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  width: 110px;
  outline: none;
  transition: var(--transition);
}
.chat-custom-lang-input:focus {
  border-color: var(--primary);
  background: rgba(0,166,81,0.05);
}

[data-theme="light"] .chat-custom-lang-input {
  background: #fff;
}

[data-theme="light"] .chat-lang-btn.active {
  background: var(--primary);
  color: #fff;
}

[data-theme="light"] .chat-input-area {
  background: rgba(0,0,0,0.02);
}

[data-theme="light"] .chat-textarea {
  background: var(--background-card);
}

[data-theme="light"] .chat-msg-ai .chat-msg-bubble {
  background: var(--background-elevated);
}

@media (max-width: 600px) {
  .chat-msg-bubble {
    max-width: 90%;
    font-size: 0.85rem;
  }

  .chat-header {
    padding: 12px 14px;
    gap: 10px;
  }

  .chat-header-row-top {
    flex-wrap: wrap;
    gap: 8px;
  }

  .chat-header-buttons {
    gap: 6px;
  }

  .chat-header-row-bottom {
    gap: 8px;
  }

  .chat-messages {
    padding: 12px 14px;
  }

  .chat-lang-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .btn-chat-clear span,
  .btn-chat-action span {
    display: none;
  }

  .btn-chat-clear,
  .btn-chat-action {
    padding: 6px 8px;
  }
}

/* ====================================
   SMART ALERT
   ==================================== */
.smart-alert {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, rgba(229, 62, 62, 0.1), rgba(229, 62, 62, 0.05));
  border: 1px solid rgba(229, 62, 62, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  animation: alertPulse 2s ease-in-out infinite;
}

@keyframes alertPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(229, 62, 62, 0); }
}

.smart-alert-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(229, 62, 62, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e53e3e;
}

.smart-alert-body h4 {
  color: #e53e3e;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 1rem;
}

.smart-alert-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ====================================
   HEALTH ASSESSMENT CIRCLE
   ==================================== */
.health-assessment {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.health-circle-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
}

.health-circle-svg {
  width: 100%;
  height: 100%;
}

#healthCirclePath {
  transition: stroke-dashoffset 1.5s ease-out, stroke 0.5s;
}

.health-circle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.health-pct {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
}

.health-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ====================================
   DIETARY SECTION
   ==================================== */
.dietary-section {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.dietary-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.dietary-title svg {
  color: var(--primary);
}

.dietary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dietary-list li {
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
  border-right: 4px solid var(--primary);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

[dir="ltr"] .dietary-list li {
  border-right: none;
  border-left: 4px solid var(--primary);
}

/* ====================================
   TERM MODAL & BUTTONS
   ==================================== */
.term-modal-overlay {
  z-index: 10000;
}

.modal-term {
  max-width: 480px;
}

.term-modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.term-modal-title-row h2 {
  color: var(--primary);
  font-size: 1.1rem;
  margin: 0;
}

.btn-term-speak {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  color: var(--primary);
  transition: background 0.2s;
}

.btn-term-speak:hover {
  background: var(--bg);
}

.term-modal-body {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text);
  min-height: 60px;
}

.term-modal-body p {
  margin: 0;
}

.term-tooltip-loading {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.loader-small {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.term-actions {
  display: inline-flex;
  gap: 4px;
  margin-inline-start: 6px;
  vertical-align: middle;
}

.term-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  padding: 0;
}

.term-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.term-btn-dict {
  color: var(--primary);
}

.term-btn-enc {
  color: #f59e0b;
}

.term-btn-enc:hover {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

.term-modal-enc-link {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn-enc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--primary), #059669);
  color: #fff;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
}

.btn-enc-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.term-btn-speak {
  color: var(--accent);
}

/* ====================================
   SHARE MODAL
   ==================================== */
.modal-small {
  max-width: 420px;
}

.share-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.share-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.share-link-box input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.8rem;
  font-family: monospace;
}

.share-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 12px;
  text-align: center;
}

/* ====================================
   MODE TABS RESPONSIVE
   ==================================== */
.mode-tabs {
  flex-wrap: wrap;
}

/* ====================================
   STATS COUNTER
   ==================================== */
.stats-counter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 10px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 40px;
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-item svg {
  color: var(--primary);
}

.stat-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  min-width: 18px;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ====================================
   INTERACTIVE BODY MAP
   ==================================== */
.body-map-section {
  margin: 24px 0;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
}

.body-map-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.body-map-title svg {
  color: var(--primary);
}

.body-map-container {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.body-map-svg-wrap {
  flex-shrink: 0;
  width: 180px;
}

.body-map-svg {
  width: 100%;
  height: auto;
}

.body-map-svg [id^="organ-"] {
  cursor: pointer;
  transition: opacity 0.3s ease, fill 0.3s ease;
}

.body-map-svg [id^="organ-"]:hover {
  opacity: 1 !important;
  filter: brightness(1.2);
}

.body-map-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.body-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--background-elevated);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.body-legend-item:hover {
  border-color: var(--primary);
}

.body-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.body-legend-dot.green { background: #4ade80; }
.body-legend-dot.yellow { background: #fbbf24; }
.body-legend-dot.red { background: #f87171; }

.body-legend-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.body-legend-status {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-right: auto;
}

[dir="ltr"] .body-legend-status {
  margin-left: auto;
  margin-right: 0;
}

@media (max-width: 600px) {
  .body-map-container {
    flex-direction: column;
    align-items: center;
  }
  .body-map-svg-wrap {
    width: 140px;
  }
  .body-map-legend {
    width: 100%;
  }
}

/* ====================================
   IMAGE QUALITY BADGES
   ==================================== */
.quality-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.quality-good {
  background: rgba(34, 197, 94, 0.85);
  color: #fff;
}

.quality-fair {
  background: rgba(245, 158, 11, 0.85);
  color: #fff;
}

.quality-poor {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

.preview-item {
  position: relative;
}

/* ====================================
   CAMERA BUTTON
   ==================================== */
.btn-camera {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 20px;
  background: rgba(0, 166, 81, 0.1);
  border: 1px solid var(--primary);
  border-radius: 24px;
  color: var(--primary);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-camera:hover {
  background: rgba(0, 166, 81, 0.2);
  transform: scale(1.02);
}

@media (hover: none) and (pointer: coarse) {
  .btn-camera {
    display: inline-flex;
  }
}

/* ====================================
   FAB - FLOATING ACTION BUTTON
   ==================================== */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 166, 81, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fabPulse 2s infinite;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0, 166, 81, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0, 166, 81, 0.4); }
  50% { box-shadow: 0 4px 24px rgba(0, 166, 81, 0.6); }
}

@media (min-width: 769px) {
  .fab { display: none !important; }
}

/* ====================================
   GDPR CONSENT BANNER (compact)
   ==================================== */
.gdpr-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 8px 16px;
  animation: slideUp 0.4s ease;
  max-width: 520px;
  width: auto;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.gdpr-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gdpr-content svg {
  flex-shrink: 0;
  color: var(--primary);
}

.gdpr-content p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.gdpr-accept {
  flex-shrink: 0;
  padding: 5px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.gdpr-accept:hover {
  background: var(--primary-dark);
}

@media (max-width: 540px) {
  .gdpr-banner {
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
    bottom: 12px;
  }
  @keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
}
button#btnShareLink {
    display: none;
}

/* ====================================
   END OF STYLESHEET
   ==================================== */
   
