/* ==========================================================================
   Egypt Drug Encyclopedia - Master Stylesheet
   مرجع موسوعة الدواء المصرية | الهوية البصرية والتصميم الطبي السريري
   Compatible with EDA Decree 480/2026, Full RTL, Tailwind CDN & Phosphor Icons
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Typography & Font Face
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

/* --------------------------------------------------------------------------
   2. Design Tokens & CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Primary Healthcare Brand Palette (Teal & Emerald) */
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #14b8a6;
  --primary-50: #f0fdfa;
  --primary-100: #ccfbf1;
  --primary-200: #99f6e4;
  --primary-800: #115e59;
  --primary-900: #134e4a;

  /* Secondary Clinical Blue & Sky */
  --secondary: #0284c7;
  --secondary-hover: #0369a1;
  --secondary-light: #38bdf8;
  --secondary-50: #f0f9ff;
  --secondary-100: #e0f2fe;
  --secondary-200: #bae6fd;
  --secondary-900: #0c4a6e;

  /* Clinical Neutral Slate Palette */
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;

  /* Regulatory & Caution Amber (Repricing & Warnings) */
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --amber-50: #fffbeb;

  /* Danger & Major Interaction Rose/Red */
  --rose-500: #e11d48;
  --rose-600: #be123c;
  --rose-100: #ffe4e6;
  --rose-50: #fff1f2;

  /* Duplicate Active Ingredient Alert (Purple) */
  --purple-500: #7c3aed;
  --purple-600: #6d28d9;
  --purple-100: #ede9fe;
  --purple-50: #faf5ff;

  /* Bioequivalence & Savings Emerald */
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-100: #d1fae5;
  --emerald-50: #ecfdf5;

  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-teal: 0 12px 24px -4px rgba(13, 148, 136, 0.18);
  --shadow-rose: 0 12px 24px -4px rgba(225, 29, 72, 0.18);
  --shadow-purple: 0 12px 24px -4px rgba(124, 58, 237, 0.18);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;
}

/* --------------------------------------------------------------------------
   3. Base HTML & Arabic RTL Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  direction: rtl;
  text-align: right;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  direction: rtl;
  text-align: right;
  background-color: var(--slate-50);
  color: var(--slate-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Selection Color */
::selection {
  background-color: #ccfbf1;
  color: #0f766e;
}

/* Custom Healthcare Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--slate-100);
}
::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* --------------------------------------------------------------------------
   4. Bidirectional Text Isolation Utilities (Mandatory for Mixed Rx/Formulas)
   -------------------------------------------------------------------------- */
.ltr-isolate {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  display: inline-block;
  font-family: system-ui, -apple-system, sans-serif;
}

.rtl-isolate {
  direction: rtl !important;
  unicode-bidi: isolate !important;
  display: inline-block;
  font-family: 'Cairo', sans-serif;
}

bdi[dir="ltr"], span[dir="ltr"], code[dir="ltr"] {
  unicode-bidi: isolate;
  direction: ltr;
  text-align: left;
}

/* Currency & Numbers styling */
.egp-currency {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  margin-right: 0.25rem;
}

.font-mono-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   5. Glassmorphism & Navbar Effects
   -------------------------------------------------------------------------- */
.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.85);
}

/* --------------------------------------------------------------------------
   6. Custom Medical Badges & Status Indicators
   -------------------------------------------------------------------------- */
/* Prescription Badges */
.badge-otc {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-rx {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-jadwal {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 0.725rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* 6-Badge Instant Safety Matrix Styles */
.safety-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-xl);
  font-size: 0.8125rem;
  font-weight: 600;
  border-width: 1px;
  border-style: solid;
  transition: all 0.2s ease;
}

.safety-badge:hover {
  transform: translateY(-1px);
}

.safety-badge-safe {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.safety-badge-caution {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.safety-badge-unsafe,
.safety-badge-danger {
  background-color: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.safety-badge-unknown {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

/* Shortage Badges */
.badge-shortage {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #f87171;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-available {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Repricing Badges */
.badge-price-up {
  background-color: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-md);
}

.badge-price-down {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   7. Card Hover Elevation & Modern Interactive Cards
   -------------------------------------------------------------------------- */
.card-hover-elevation {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--slate-200);
}

.card-hover-elevation:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-teal);
  border-color: rgba(13, 148, 136, 0.4);
}

.drug-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--slate-200);
  overflow: hidden;
}

.drug-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-light);
  box-shadow: 0 14px 28px -4px rgba(13, 148, 136, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
}

/* Feature card styles */
.feature-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* --------------------------------------------------------------------------
   8. Price Comparison & Bioequivalence Substitutes Engine Highlights
   -------------------------------------------------------------------------- */
.exact-generic-card {
  border: 2px solid #10b981;
  background: linear-gradient(to bottom, #f0fdf4, #ffffff);
  border-radius: var(--radius-2xl);
  position: relative;
  transition: all 0.25s ease;
}

.exact-generic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -4px rgba(16, 185, 129, 0.2);
}

.therapeutic-alt-card {
  border: 1.5px solid #0284c7;
  background: linear-gradient(to bottom, #f0f9ff, #ffffff);
  border-radius: var(--radius-2xl);
  position: relative;
  transition: all 0.25s ease;
}

.therapeutic-alt-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -4px rgba(2, 132, 199, 0.2);
}

/* Savings Ribbon / Badge */
.price-saving-badge {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
}

.unit-price-pill {
  background: var(--slate-100);
  color: var(--slate-600);
  font-size: 0.725rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  border: 1px solid var(--slate-200);
}

/* --------------------------------------------------------------------------
   9. Clean Medical Data Tables Formatting
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
  background: #ffffff;
}

.medical-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: right;
  font-size: 0.875rem;
}

.medical-table thead th {
  background-color: var(--slate-100);
  color: var(--slate-700);
  font-weight: 700;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--slate-200);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.medical-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-800);
  vertical-align: middle;
  transition: background-color 0.15s ease;
}

.medical-table tbody tr:last-child td {
  border-bottom: none;
}

.medical-table tbody tr:hover td {
  background-color: #f0fdfa;
}

.medical-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

/* --------------------------------------------------------------------------
   10. Search Autocomplete Dropdown Formatting
   -------------------------------------------------------------------------- */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 0.5rem;
  background-color: #ffffff;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--slate-200);
  box-shadow: 0 20px 30px -8px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  max-height: 420px;
  overflow-y: auto;
  padding: 0.5rem;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: var(--slate-800);
}

.autocomplete-item:hover,
.autocomplete-item.active,
.autocomplete-item.is-selected {
  background-color: #f0fdfa;
  border-color: #ccfbf1;
  color: #0f766e;
}

.autocomplete-item.active .drug-title,
.autocomplete-item:hover .drug-title {
  color: #0d9488;
}

/* Thumbnail */
.drug-thumb-placeholder {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-lg);
  background-color: #ccfbf1;
  color: #0d9488;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   11. Interaction Checker UI & Severity Alerts
   -------------------------------------------------------------------------- */
#selected-drugs-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2.75rem;
}

.drug-regimen-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: #f0fdfa;
  border: 1.5px solid #99f6e4;
  color: #115e59;
  font-size: 0.875rem;
  font-weight: 700;
  animation: pillPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pillPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.drug-regimen-pill .remove-pill-btn {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ccfbf1;
  color: #0f766e;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.75rem;
  line-height: 1;
}

.drug-regimen-pill .remove-pill-btn:hover {
  background-color: #f43f5e;
  color: #ffffff;
}

/* Interaction Alert Cards */
.interaction-alert-card {
  border-radius: var(--radius-2xl);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-width: 1.5px;
  border-style: solid;
  animation: slideFadeIn 0.3s ease-out;
  box-shadow: var(--shadow-sm);
}

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

/* Duplicate Ingredient Alert */
.interaction-card-duplicate {
  background: linear-gradient(to left, #faf5ff, #ffffff);
  border-color: #c084fc;
  box-shadow: var(--shadow-purple);
}

/* Major Drug-Drug Interaction Alert */
.interaction-card-major {
  background: linear-gradient(to left, #fff1f2, #ffffff);
  border-color: #fb7185;
  box-shadow: var(--shadow-rose);
}

/* Moderate Interaction Alert */
.interaction-card-moderate {
  background: linear-gradient(to left, #fffbeb, #ffffff);
  border-color: #fcd34d;
}

/* Minor Interaction Alert */
.interaction-card-minor {
  background: linear-gradient(to left, #f0f9ff, #ffffff);
  border-color: #7dd3fc;
}

/* Safe - No Interactions Alert */
.interaction-card-safe {
  background: linear-gradient(to left, #ecfdf5, #ffffff);
  border-color: #6ee7b7;
}

/* --------------------------------------------------------------------------
   12. Clinical Calculators Styling & Visual CKD Meter
   -------------------------------------------------------------------------- */
/* Pediatric Range Slider */
.calc-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  outline: none;
  transition: background 0.2s;
}

.calc-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0d9488;
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background-color 0.15s;
}

.calc-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #0f766e;
}

.calc-range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0d9488;
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* CKD Stage Visual Meter */
.ckd-stage-meter {
  position: relative;
  height: 24px;
  border-radius: var(--radius-full);
  background: linear-gradient(to left, #ef4444 0%, #f97316 25%, #facc15 50%, #34d399 75%, #10b981 100%);
  margin: 1.5rem 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.ckd-meter-marker {
  position: absolute;
  top: -8px;
  transform: translateX(50%);
  width: 16px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.ckd-meter-needle {
  width: 4px;
  height: 100%;
  background-color: #0f172a;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.ckd-meter-head {
  width: 12px;
  height: 12px;
  background-color: #0f172a;
  border-radius: 50%;
  margin-top: -6px;
  border: 2px solid #ffffff;
}

/* --------------------------------------------------------------------------
   13. Pill Identifier Visual Filter Controls
   -------------------------------------------------------------------------- */
.pill-shape-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--slate-200);
  background: #ffffff;
  color: var(--slate-700);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-shape-chip:hover,
.pill-shape-chip.active {
  border-color: #0d9488;
  background-color: #f0fdfa;
  color: #0f766e;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pill-color-swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1.5px var(--slate-300);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.pill-color-swatch:hover,
.pill-color-swatch.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2.5px #0d9488, 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   14. Shortage Radar Report Form & Upvote Animation
   -------------------------------------------------------------------------- */
.upvote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--slate-200);
  background: #ffffff;
  color: var(--slate-600);
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upvote-btn:hover {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #e11d48;
}

.upvote-btn.has-upvoted {
  background: #ffe4e6;
  border-color: #fb7185;
  color: #be123c;
}

.upvote-btn.has-upvoted i {
  animation: heartPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   15. Toast Notifications System
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 24rem;
  width: calc(100% - 3rem);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-xl);
  background: #ffffff;
  color: var(--slate-800);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--slate-200);
  direction: rtl;
  text-align: right;
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.25s ease;
}

.toast.toast-hide {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

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

.toast-success {
  border-right: 4px solid #10b981;
}
.toast-success .toast-icon {
  color: #10b981;
}

.toast-error {
  border-right: 4px solid #e11d48;
}
.toast-error .toast-icon {
  color: #e11d48;
}

.toast-warning {
  border-right: 4px solid #f59e0b;
}
.toast-warning .toast-icon {
  color: #f59e0b;
}

.toast-info {
  border-right: 4px solid #0284c7;
}
.toast-info .toast-icon {
  color: #0284c7;
}

/* --------------------------------------------------------------------------
   16. Animated Marquee Ticker
   -------------------------------------------------------------------------- */
@keyframes tickerAnim {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
}

.ticker-move {
  display: inline-flex;
  animation: tickerAnim 45s linear infinite;
}

.ticker-move:hover {
  animation-play-state: paused;
}

/* --------------------------------------------------------------------------
   17. Responsive Mobile Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  body {
    font-size: 0.9375rem;
  }
  
  .drug-card {
    border-radius: var(--radius-xl);
  }
  
  #toast-container {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: none;
  }
  
  .medical-table thead th,
  .medical-table tbody td {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .safety-badge {
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   17B. Altibbi Competitor Integration UI Components
   Verified Doctor Consultations, Overdose Gauge, Monograph & FAQs
   -------------------------------------------------------------------------- */
.doctor-consultation-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.doctor-consultation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.1), 0 8px 10px -6px rgba(2, 132, 199, 0.05);
}

.doctor-avatar-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.doctor-avatar-wrap img {
  border-radius: 9999px;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.doctor-quote-box {
  position: relative;
  border-right: 4px solid var(--secondary);
  background: linear-gradient(180deg, #f8fafc 0%, #f0f9ff 100%);
  border-radius: 0.75rem 0 0 0.75rem;
  unicode-bidi: plaintext;
  text-align: right;
  direction: rtl;
}

.overdose-protocol-card {
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #4c0519 50%, #020617 100%);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.emergency-hotline-pill {
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.emergency-hotline-pill:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.35);
}

.clinical-monograph-card {
  transition: all 0.2s ease;
}

/* FAQ Details & Summary styling */
details.faq-accordion summary::-webkit-details-marker {
  display: none !important;
}

details.faq-accordion summary {
  list-style: none !important;
}

/* --------------------------------------------------------------------------
   18. Professional Print Stylesheet (@media print)
   Clean formatting for Drug Monographs, Overdose Protocol & Doctor Consultations
   -------------------------------------------------------------------------- */
@media print {
  /* Hide all non-printable chrome and interactive elements */
  header,
  footer,
  nav,
  #mobileNav,
  #searchModal,
  #toast-container,
  .no-print,
  button,
  .btn,
  form,
  .calc-range-slider,
  .ticker-wrap,
  .upvote-btn,
  .drug-regimen-pill .remove-pill-btn,
  .animate-ping,
  .animate-pulse,
  .ph-quotes {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    direction: rtl !important;
    text-align: right !important;
    margin: 0 !important;
    padding: 0.5cm !important;
  }

  a {
    color: #000000 !important;
    text-decoration: none !important;
  }

  /* Show Print Only Official Header */
  .print-only {
    display: block !important;
  }

  /* Avoid break inside important blocks */
  .drug-monograph,
  .monograph-section,
  .safety-matrix-grid,
  .pediatric-report-card,
  .medical-table tr,
  .interaction-alert-card,
  .doctor-consultation-card,
  .clinical-monograph-card,
  .overdose-protocol-card,
  .quote-box,
  details {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* High contrast borders and boxes */
  .card-hover-elevation,
  .drug-card,
  .glass-card,
  .exact-generic-card,
  .therapeutic-alt-card,
  .doctor-consultation-card,
  .clinical-monograph-card {
    border: 1px solid #475569 !important;
    box-shadow: none !important;
    transform: none !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* Doctor Answer Quote in Print */
  .doctor-quote-box,
  .quote-box {
    border: 1px solid #94a3b8 !important;
    border-right: 4px solid #000000 !important;
    background: #f8fafc !important;
    color: #000000 !important;
    box-shadow: none !important;
  }

  /* Overdose card print layout: avoid solid dark fills that waste toner */
  .overdose-protocol-card {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
  }

  .overdose-protocol-card h3,
  .overdose-protocol-card h4,
  .overdose-protocol-card p,
  .overdose-protocol-card span,
  .overdose-protocol-card div {
    color: #000000 !important;
    text-shadow: none !important;
  }

  .emergency-hotline-pill {
    background: #ffffff !important;
    border: 2px solid #b91c1c !important;
    color: #000000 !important;
  }

  .emergency-hotline-pill a {
    color: #b91c1c !important;
    font-weight: bold !important;
    text-decoration: underline !important;
  }

  /* Force all FAQ details to be open and visible in print */
  details,
  details[open],
  details:not([open]) {
    display: block !important;
    border: 1px solid #cbd5e1 !important;
    margin-bottom: 0.5rem !important;
  }

  details > summary {
    display: block !important;
    font-weight: bold !important;
    color: #000000 !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  details > div,
  details > summary ~ * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Clean tables */
  .table-responsive {
    border: 1px solid #000000 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .medical-table thead th {
    background-color: #f1f5f9 !important;
    color: #000000 !important;
    border-bottom: 2px solid #000000 !important;
  }

  .medical-table tbody td {
    border-bottom: 1px solid #cbd5e1 !important;
  }

  /* Badges high contrast printing */
  .safety-badge,
  .badge-rx,
  .badge-otc,
  .badge-jadwal {
    border: 1px solid #000000 !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* Print footer notice */
  .print-footer-notice {
    display: block !important;
    margin-top: 2cm;
    border-top: 1px dashed #64748b;
    padding-top: 0.5cm;
    font-size: 9pt;
    color: #475569;
  }
}
