:root {
  --bg: #0d1b2a;
  --bg-soft: #14283c;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-solid: #ffffff;
  --border: rgba(255, 255, 255, 0.12);
  --text: #eaf2f8;
  --text-dim: #9fb3c8;
  --primary: #18c29c;
  --primary-d: #0fa583;
  --accent: #4cb8ff;
  --danger: #ff6b6b;
  --warn: #ffcf5c;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -10%, #1b3a52 0%, transparent 60%),
              radial-gradient(1000px 700px at 0% 0%, #143b34 0%, transparent 55%),
              var(--bg);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
}

.container { width: min(1140px, 92%); margin-inline: auto; }

/* ── حباب‌های پس‌زمینه ─────────────────────────────────── */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.orb-1 { width: 380px; height: 380px; background: #18c29c; top: -80px; left: -60px; animation: float 16s ease-in-out infinite; }
.orb-2 { width: 320px; height: 320px; background: #4cb8ff; bottom: -60px; right: -40px; animation: float 20s ease-in-out infinite reverse; }
.orb-3 { width: 260px; height: 260px; background: #7c5cff; top: 40%; right: 30%; animation: float 24s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,-30px); } }

/* ── هدر ───────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(13, 27, 42, 0.72);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { font-size: 34px; filter: drop-shadow(0 4px 10px rgba(24,194,156,.5)); }
.brand-text h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.brand-text p { font-size: 12.5px; color: var(--text-dim); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--text-dim); background: transparent;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 16px;
  transition: all 0.2s ease;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.is-active { color: #06231c; background: linear-gradient(135deg, var(--primary), var(--accent)); border-color: transparent; box-shadow: 0 8px 20px rgba(24,194,156,.35); }

/* ── پنل‌ها ─────────────────────────────────────────────── */
.panel { display: none; padding: 30px 0 60px; animation: fade 0.35s ease; }
.panel.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.section-head p { color: var(--text-dim); font-size: 14.5px; max-width: 720px; }

/* ── کارت کنترل‌ها ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.controls {
  display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
  padding: 18px; margin-bottom: 22px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 200px; flex: 1; }
.field-grow { flex: 1 1 100%; }
.field label { font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.field input, .field select {
  font-family: var(--font); font-size: 15px; color: var(--text);
  background: rgba(0,0,0,0.25); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; outline: none; transition: border 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: #6f859b; }
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,194,156,.18); }
.field select option { color: #11202f; }

.btn {
  font-family: var(--font); font-size: 15px; font-weight: 700; cursor: pointer;
  border: none; border-radius: 12px; padding: 12px 22px; transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { color: #042019; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 10px 24px rgba(24,194,156,.35); }
.btn-primary:hover { box-shadow: 0 14px 30px rgba(24,194,156,.5); }
.btn-ghost { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.btn-nav { color: #042019; background: linear-gradient(135deg, #4cb8ff, #18c29c); padding: 9px 16px; font-size: 13.5px; }
.btn-call { color: var(--text); background: var(--surface); border: 1px solid var(--border); padding: 9px 16px; font-size: 13.5px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* ── وضعیت/پیام ─────────────────────────────────────────── */
.status { padding: 14px 18px; border-radius: 14px; margin-bottom: 18px; font-size: 14px; border: 1px solid var(--border); }
.status.loading { background: rgba(76,184,255,.1); color: #cfe9ff; }
.status.error { background: rgba(255,107,107,.12); color: #ffd2d2; border-color: rgba(255,107,107,.3); }
.status.info { background: rgba(255,207,92,.12); color: #ffe9b8; border-color: rgba(255,207,92,.3); }
.status.success { background: rgba(24,194,156,.12); color: #c4f5e8; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge-live { background: rgba(24,194,156,.2); color: #8ef0d6; }
.badge-sample { background: rgba(255,207,92,.2); color: #ffe09a; }

/* ── شبکه‌ی نتایج داروخانه ───────────────────────────────── */
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.pharm-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  animation: fade 0.4s ease both;
}
.pharm-card:hover { transform: translateY(-4px); border-color: rgba(24,194,156,.5); }
.pharm-card::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: linear-gradient(var(--primary), var(--accent)); }
.pharm-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.pharm-name { font-size: 17px; font-weight: 700; }
.pharm-rank { font-size: 12px; font-weight: 700; color: #042019; background: var(--primary); border-radius: 999px; padding: 3px 9px; }
.pharm-row { display: flex; gap: 8px; align-items: flex-start; color: var(--text-dim); font-size: 13.5px; margin-bottom: 7px; }
.pharm-row .ic { flex-shrink: 0; }
.pharm-dist { font-weight: 700; color: var(--accent); }
.pharm-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ── داروها ─────────────────────────────────────────────── */
.disclaimer {
  background: rgba(255,207,92,.1); border: 1px solid rgba(255,207,92,.3);
  color: #ffe9b8; border-radius: 14px; padding: 13px 16px; font-size: 13.5px; margin-bottom: 18px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--text-dim); background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px; transition: all 0.18s;
}
.chip:hover { color: var(--text); border-color: var(--primary); }
.chip.is-active { color: #042019; background: linear-gradient(135deg, var(--primary), var(--accent)); border-color: transparent; }
.count-line { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }

.meds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.med-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); animation: fade 0.35s ease both;
  transition: transform 0.2s, border-color 0.2s;
}
.med-card:hover { transform: translateY(-3px); border-color: rgba(76,184,255,.45); }
.med-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.med-fa { font-size: 17px; font-weight: 700; }
.med-cat { font-size: 11.5px; font-weight: 700; color: #042019; background: var(--accent); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.med-eq { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.med-tr { font-weight: 700; color: var(--primary); }
.med-arrow { color: var(--text-dim); }
.med-generic { font-size: 12.5px; color: var(--text-dim); font-style: italic; }
.med-field { font-size: 13.5px; margin-bottom: 8px; }
.med-field b { color: var(--text); }
.med-field span { color: var(--text-dim); }
.rx-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-top: 4px; }
.rx-yes { background: rgba(255,107,107,.15); color: #ffb3b3; }
.rx-no { background: rgba(24,194,156,.15); color: #9bf0db; }

/* نمونه‌های برند ترکی */
.med-brands-wrap { margin: 10px 0 12px; }
.med-brands-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.med-brands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.brand-tag {
  font-size: 12.5px; font-weight: 700; color: var(--primary);
  background: rgba(24,194,156,.12); border: 1px solid rgba(24,194,156,.3);
  border-radius: 8px; padding: 3px 9px;
}
.med-side b { color: #ffcf5c; }

/* داروهای مشابه */
.med-similar { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.med-similar-h { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 8px; }
.sim-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-chip {
  font-family: var(--font); font-size: 12.5px; font-weight: 600; cursor: pointer;
  color: var(--accent); background: rgba(76,184,255,.1);
  border: 1px solid rgba(76,184,255,.3); border-radius: 999px; padding: 4px 11px;
  transition: all 0.16s;
}
.sim-chip:hover { color: #042019; background: var(--accent); border-color: transparent; }

/* ── حالت خالی ──────────────────────────────────────────── */
.empty { text-align: center; padding: 50px 20px; color: var(--text-dim); }
.empty .emo { font-size: 46px; display: block; margin-bottom: 10px; }

/* ── لودر ───────────────────────────────────────────────── */
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.25); border-top-color: var(--accent); border-radius: 50%; display: inline-block; vertical-align: middle; margin-inline-end: 8px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── فوتر ───────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); padding: 22px 0; text-align: center; }
.site-footer p { color: var(--text-dim); font-size: 13px; }

@media (max-width: 640px) {
  .brand-text p { display: none; }
  .section-head h2 { font-size: 22px; }
  .controls { padding: 14px; }
  .btn { width: 100%; }
  .field { min-width: 100%; }
}
