/* styles/design-system-v3.css
   Purpose: a fresh, cleaner UI polish layer for the whole blue-ui-kit site.
   - Works with BOTH dark (blue-theme.css) and light (ocean-2026.css) by reusing existing CSS variables.
   - Overrides spacing/typography/components without changing app structure.
*/

/* ====== Typography + sizing polish ====== */
:root{
  /* Prefer Arabic-friendly fonts when available */
  --font: "Tajawal", "Cairo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Tahoma, Arial;

  /* Slightly more modern radii (keep compatibility with existing tokens) */
  --r: 20px;
  --r2: 16px;
  --r3: 14px;
}

body{
  font-family: var(--font);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings: tighter + more “clinical” */
.h1, h1{ letter-spacing: -0.01em; }
.sectionTitle, h2{ letter-spacing: -0.01em; }

/* ====== Medication page: section nav (anchors/tabs) ====== */
.sectionNav{
  position: sticky;
  top: 70px;
  z-index: 25;
  margin-top: 14px;
  /* Match Ocean theme: glassy surface like cards */
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line2, var(--line));
  border-radius: var(--r2, 16px);
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(10, 30, 46, 0.12);
}
.sectionNav__inner{
  display: flex;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  padding: 10px 12px;
  scroll-behavior: smooth;
}
.sectionNav__inner::-webkit-scrollbar{ height: 6px; }
.sectionNav__inner::-webkit-scrollbar-thumb{ background: rgba(25,118,255,.20); border-radius: 999px; }
.sectionNav a{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(25,118,255,.18);
  background: rgba(255,255,255,.06);
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  font-size: 12px;
}
.sectionNav a:hover{
  border-color: rgba(25,118,255,.32);
  background: rgba(25,118,255,.08);
  box-shadow: 0 0 0 4px rgba(25,118,255,.10);
}
.sectionNav a[aria-current="true"]{
  background: linear-gradient(135deg, rgba(25,118,255,.18), rgba(30,185,166,.14));
  border-color: rgba(25,118,255,.38);
  box-shadow: 0 10px 24px rgba(25,118,255,.10);
}

.trustBox{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  border-radius: var(--r2, 16px);
  padding: 12px 14px;
  line-height: 1.9;
}

/* ====== Topbar / navigation ====== */
.topbar{
  /* Slightly stronger separation */
  border-bottom: 1px solid var(--stroke, var(--line2, var(--line)));
  box-shadow: 0 10px 30px rgba(10, 30, 46, 0.08);
}

/* Keep top navigation in one row (no wrapping into a second line) */
.topbar .nav{
  flex-wrap: nowrap !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-width: 0;
}
.topbar .nav::-webkit-scrollbar{ display:none; }
.topbar .nav a,
.topbar .nav__link{
  white-space: nowrap;
}

/* Actions should NOT steal width from nav; scroll actions instead. */
.topbar__actions{
  min-width: 0 !important;
  flex: 0 1 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topbar__actions::-webkit-scrollbar{ display:none; }

/* Mobile-only search icon in topbar actions */
.topbarSearchBtn{ display:none; }
@media (max-width: 520px){
  .topbarSearchBtn{
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 14px;
    line-height: 1;
  }
}

/* Small screens: keep header organized (2 clean rows, not 3+ wrapped lines) */
@media (max-width: 520px){
  .topbar__inner{
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    gap: 10px;
    align-items: center;
    padding: 10px 0;
  }
  .topbar__inner .brand{ grid-area: brand; min-width: 0; }
  .topbar__inner .topbar__actions{ grid-area: actions; min-width: 0; flex-wrap: nowrap; }
  .topbar__inner .nav{
    grid-area: nav;
    justify-content: flex-start;
    width: 100%;
  }
  .topbar__inner .nav__link{
    font-size: 12px;
    padding: 8px 10px;
  }
}

@media (max-width: 360px){
  .topbar__inner{ gap: 8px; }
  .topbar__inner .nav__link{ font-size: 11.5px; padding: 7px 9px; }
}

/* ====== Home HERO: exactly in the middle (no side effects) ======
   - pages.css makes .hero a 2-column grid, so content was in the right column (RTL).
   - Override to single column and center the wrapper so left/right space is equal.
*/
.hero:has(.heroWrap) {
  display: block;
}
.hero:has(.heroWrap) .container {
  display: block;
  width: 100%;
}
.heroWrap {
  max-width: 900px;
  margin-inline: auto;
  padding-inline: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Ensure the badge pill is centered inside the hero */
.heroWrap .hero-badge{
  width: 100%;
  display: flex;
  justify-content: center;
}
.heroWrap .badge{
  margin-inline: auto;
}

/* The badge was visually off-center because ocean-2026.css adds a pseudo-dot (::before)
   while the HTML already contains a dot element. Remove the pseudo-dot ONLY in the hero. */
.heroWrap .badge::before{
  content: none !important;
}

.brand{
  gap: 12px;
}
.brand__name{
  /* Improve Arabic readability */
  font-weight: 900;
}

.nav{
  gap: 10px;
}

.nav__link{
  padding: 10px 14px;
  font-weight: 800;
  border-radius: 14px;
}

/* Active tab: clearer but subtle */
.nav__link--active{
  border-color: rgba(45,124,255,.22);
  background: rgba(45,124,255,.12);
}

@media (max-width: 820px){
  .nav{
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar{ display:none; }
  .nav__link{ white-space: nowrap; }
}

/* ====== Cards ====== */
.card{
  border-radius: 22px;
  border-color: var(--line2, var(--line));
}
.card__pad{
  padding: 16px;
}

/* Hover: less “jumpy”, more premium */
.drugCard:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow2, 0 14px 40px rgba(0,0,0,0.12));
}

/* Card titles */
.drugCard__title{
  font-size: 18px;
  line-height: 1.45;
}
.drugCard__sub{
  line-height: 1.6;
}

/* ====== Buttons ====== */
.btn{
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 900;
  letter-spacing: 0;
}

/* Support both naming styles: .btn--primary and .btn-primary */
.btn--primary,
.btn-primary{
  border: 1px solid rgba(45,124,255,.18);
  background: linear-gradient(135deg, rgba(45,124,255,.22), rgba(35,182,214,.18));
  color: var(--ink, #0B1B2A);
}
.btn--primary:hover,
.btn-primary:hover{
  filter: brightness(1.02);
}

/* Home hero: make "ابدأ البحث" a bit lighter blue */
.heroWrap .hero-actions .btn--primary,
.heroWrap .hero-actions .btn-primary{
  border-color: rgba(45,124,255,.20);
  background: linear-gradient(135deg, rgba(45,124,255,.26), rgba(35,182,214,.20));
}
.heroWrap .hero-actions .btn--primary:hover,
.heroWrap .hero-actions .btn-primary:hover{
  filter: brightness(1.02);
}

.btn--ghost,
.btn-ghost{
  background: transparent;
}

.btn-soft{
  /* Slightly blue, but softer than primary */
  border-color: rgba(45,124,255,.22);
  background: rgba(45,124,255,.075);
}

/* ====== Inputs ====== */
.input, .select, .textarea{
  border-radius: 16px;
  border-color: var(--line2, var(--line));
}

/* Make placeholders a bit clearer */
::placeholder{ color: rgba(76,100,122,0.75); }

/* ====== Pills / badges ====== */
.pill, .badge{
  border-radius: 999px;
  font-weight: 800;
}

/* ====== Results bar / spacing ====== */
.resultsBar{
  gap: 14px;
}

/* ====== Home feature rows (no box) ====== */
.feature-plain{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  cursor: default;
}

/* ====== A–Z keyboard ====== */
.az{
  gap: 8px;
}
.azKey{
  /* Make it feel like "letters only" (no boxes) */
  width: auto;
  min-width: unset;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 6px 8px;
  cursor: pointer;
}
.azKey__letter{
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--text, inherit);
  opacity: .9;
}

/* Hide counts: user asked for letters only */
.azKey__count{ display:none !important; }

/* Hover/active: simple underline instead of a box */
.azKey:hover .azKey__letter{
  opacity: 1;
  color: var(--brand, #1976ff);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}
.azKey--active .azKey__letter{
  opacity: 1;
  color: var(--brand, #1976ff);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 3px;
}

/* ====== Modal ====== */
.modal__card{
  border-radius: 22px;
}

/* ====== RTL/LTR small fixes ====== */
html[dir="ltr"] .drugCard__head{
  flex-direction: row;
}
html[dir="rtl"] .drugCard__head{
  flex-direction: row-reverse;
}

/* ====== Auth buttons (topbar) ======
   Make login/register small + light blue, matching Ocean theme. */
.topbar__actions #authBtns{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.topbar__actions #authBtns .btn{
  padding: 5px 8px;
  border-radius: 12px;
  font-size: 10.75px;
  font-weight: 950;
  line-height: 1.15;
}
.btn--authLight{
  border: 1px solid rgba(45,124,255,.12) !important;
  background: linear-gradient(135deg, rgba(45,124,255,.055), rgba(35,182,214,.055)) !important;
  color: var(--ink, #0B1B2A) !important;
  box-shadow: 0 10px 22px rgba(10,40,80,.10) !important;
}
.btn--authLight:hover{
  background: linear-gradient(135deg, rgba(45,124,255,.075), rgba(35,182,214,.075)) !important;
  transform: translateY(-1px);
}
.btn--authLight:active{ transform:none; }
.btn--authLightGhost{
  background: rgba(45,124,255,.028) !important;
  box-shadow: none !important;
}

/* ====== Site footer (identity) ====== */
.footer--site{
  margin-top: 28px;
  border-top: 1px solid var(--line2, var(--line));
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}
.footer--site .footer__inner{
  display:flex;
  gap:14px;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
  padding: 18px 0;
}
.footer--site .footer__brand{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  min-width: 240px;
}
.footer--site .footer__title{
  font-weight: 950;
  letter-spacing: -0.01em;
}
.footer--site .footer__meta{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.footer--site .footer__links{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.footer--site a.footerLink{
  text-decoration:none;
  color: inherit;
}
.footer--site .footer__note{
  width: 100%;
  margin-top: 8px;
  opacity: .9;
  line-height: 1.9;
}

