/* style.css */
/* Light mode is default. Dark mode via html[data-theme="dark"] */

:root{
  --bg:#f7fafc;
  --panel:#ffffffcc;
  --panelSolid:#ffffff;
  --card:#ffffff;
  --stroke:#d7e2ef;
  --text:#071018;
  --muted:#3d566f;
  --soft:#5f7893;
  --accent:#12c9ab;
  --accent2:#2f7cff;
  --danger:#ff3c67;
  --shadow: 0 18px 55px rgba(2,10,24,.18);
  --radius: 22px;
  --radius2: 28px;
  --safeTop: env(safe-area-inset-top, 0px);
  --safeBottom: env(safe-area-inset-bottom, 0px);
}

html[data-theme="dark"]{
  --bg:#071018;
  --panel:#0b1723cc;
  --panelSolid:#0b1723;
  --card:#0c1b28;
  --stroke:#173245;
  --text:#e9f2ff;
  --muted:#b4c6dd;
  --soft:#8aa4c4;
  --accent:#5ff0d0;
  --accent2:#6da6ff;
  --danger:#ff5a7a;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Noto Sans Arabic", sans-serif;
  background:
    radial-gradient(1200px 900px at 12% 0%, rgba(18,201,171,.14), transparent 55%),
    radial-gradient(900px 700px at 88% 10%, rgba(47,124,255,.12), transparent 50%),
    var(--bg);
  color:var(--text);
  overflow-x:hidden;
}

html[data-theme="dark"] body{
  background:
    radial-gradient(1200px 900px at 12% 0%, rgba(93,240,208,.14), transparent 55%),
    radial-gradient(900px 700px at 88% 10%, rgba(109,166,255,.12), transparent 50%),
    var(--bg);
}

.bg-orb{
  position:fixed;
  inset:auto;
  width:540px;
  height:540px;
  border-radius:50%;
  filter: blur(45px);
  opacity:.16;
  pointer-events:none;
  mix-blend-mode: multiply;
  transform: translateZ(0);
}
html[data-theme="dark"] .bg-orb{
  opacity:.18;
  mix-blend-mode: screen;
}
.orb1{ left:-180px; top:180px; background: radial-gradient(circle at 30% 30%, var(--accent), transparent 60%); }
.orb2{ right:-220px; top:-160px; background: radial-gradient(circle at 30% 30%, var(--accent2), transparent 60%); }

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  padding: calc(12px + var(--safeTop)) 16px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background: linear-gradient(to bottom, rgba(247,250,252,.92), rgba(247,250,252,.35));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(215,226,239,.85);
}

html[data-theme="dark"] .topbar{
  background: linear-gradient(to bottom, rgba(7,16,24,.88), rgba(7,16,24,.25));
  border-bottom: 1px solid rgba(23,50,69,.55);
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:42px; height:42px;
  border-radius:14px;
  background: rgba(255,255,255,.70);
  border:1px solid rgba(2,10,24,.08);
  box-shadow: 0 12px 30px rgba(2,10,24,.16);
  object-fit:contain;
  padding:6px;
}
html[data-theme="dark"] .logo{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.brandName{ font-weight:800; letter-spacing:.2px; font-size:16px; }
.brandTag{ font-size:12px; color:var(--muted); margin-top:1px; }

.topActions{ display:flex; gap:10px; }
.iconBtn{
  border:1px solid rgba(2,10,24,.10);
  background: rgba(255,255,255,.60);
  backdrop-filter: blur(10px);
  color:var(--text);
  width:44px; height:44px;
  border-radius:16px;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
html[data-theme="dark"] .iconBtn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(11,23,35,.55);
}
.iconBtn:active{ transform: scale(.98); }
.iconBtn:hover{ border-color: rgba(18,201,171,.35); }
html[data-theme="dark"] .iconBtn:hover{ border-color: rgba(95,240,208,.35); }
.icon{ font-size:16px; opacity:.95; }

.shell{
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px calc(22px + var(--safeBottom));
}

.hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  padding: 10px 2px 14px;
}
.heroText h1{
  margin:0;
  font-size: clamp(22px, 3.2vw, 34px);
  letter-spacing:-.3px;
  line-height:1.08;
}
.heroText p{
  margin:10px 0 0;
  color:var(--muted);
  font-size: 14px;
  max-width: 56ch;
}
.heroPills{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.pill{
  font-size:12px;
  color: rgba(7,16,24,.92);
  background: rgba(255,255,255,.60);
  border:1px solid rgba(2,10,24,.08);
  padding:8px 10px;
  border-radius: 999px;
}
html[data-theme="dark"] .pill{
  color: rgba(233,242,255,.92);
  background: rgba(11,23,35,.55);
  border:1px solid rgba(255,255,255,.08);
}

.carouselWrap{ position:relative; margin-top:10px; }

.carousel{
  display:flex;
  gap:14px;
  overflow:auto;
  padding: 10px 4px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  outline:none;
}
.carousel::-webkit-scrollbar{ display:none; }

.card{
  flex: 0 0 min(92vw, 420px);
  scroll-snap-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.74));
  border:1px solid rgba(2,10,24,.08);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
  transform: translateZ(0);
}
html[data-theme="dark"] .card{
  background: linear-gradient(180deg, rgba(11,23,35,.82), rgba(11,23,35,.62));
  border:1px solid rgba(255,255,255,.08);
}

.card::before{
  content:"";
  position:absolute;
  inset:-1px;
  background:
    radial-gradient(800px 320px at 20% 0%, rgba(18,201,171,.12), transparent 55%),
    radial-gradient(650px 300px at 90% 20%, rgba(47,124,255,.10), transparent 55%);
  pointer-events:none;
}
html[data-theme="dark"] .card::before{
  background:
    radial-gradient(800px 320px at 20% 0%, rgba(95,240,208,.12), transparent 55%),
    radial-gradient(650px 300px at 90% 20%, rgba(109,166,255,.10), transparent 55%);
}

.cardInner{ position:relative; padding: 18px 16px 16px; }
.cardTop{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(2,10,24,.08);
  background: rgba(255,255,255,.55);
  padding:8px 10px;
  border-radius: 999px;
  font-size:12px;
  color:var(--muted);
}
html[data-theme="dark"] .badge{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(7,16,24,.35);
}

.badgeDot{
  width:8px; height:8px; border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(18,201,171,.10);
}
html[data-theme="dark"] .badgeDot{
  box-shadow: 0 0 0 6px rgba(95,240,208,.10);
}

.cardTitle{ margin: 10px 0 0; font-size: 18px; letter-spacing:-.2px; }
.cardSub{ margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height:1.45; }

.quickList{
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.55);
  border:1px solid rgba(2,10,24,.08);
}
html[data-theme="dark"] .quickList{
  background: rgba(7,16,24,.35);
  border:1px solid rgba(255,255,255,.08);
}

.qItem{ display:flex; gap:10px; margin: 8px 0; font-size: 13px; }
.qIcon{ width:20px; text-align:center; opacity:.95; color: var(--accent); }
.qText{ color: rgba(7,16,24,.90); }
html[data-theme="dark"] .qText{ color: rgba(233,242,255,.90); }

.cardActions{ display:flex; gap:10px; margin-top: 14px; }

.btn{
  flex:1;
  border:1px solid rgba(2,10,24,.10);
  background: rgba(255,255,255,.60);
  color: var(--text);
  padding: 12px 12px;
  border-radius: 18px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-weight:700;
  letter-spacing:.1px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  text-decoration:none;
}
html[data-theme="dark"] .btn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(7,16,24,.35);
}

.btn:hover{ border-color: rgba(18,201,171,.28); }
html[data-theme="dark"] .btn:hover{ border-color: rgba(95,240,208,.25); }
.btn:active{ transform: scale(.99); }

.btn.primary{
  background: linear-gradient(180deg, rgba(18,201,171,.16), rgba(18,201,171,.08));
  border-color: rgba(18,201,171,.30);
}
html[data-theme="dark"] .btn.primary{
  background: linear-gradient(180deg, rgba(95,240,208,.18), rgba(95,240,208,.08));
  border-color: rgba(95,240,208,.35);
}

.btnIcon{ opacity:.95; }

.dots{ display:flex; justify-content:center; gap:8px; padding: 0 0 8px; }
.dot{ width:7px; height:7px; border-radius:999px; background: rgba(61,86,111,.28); transition: width .2s ease, background .2s ease; }
html[data-theme="dark"] .dot{ background: rgba(180,198,221,.35); }
.dot.active{ width:22px; background: rgba(18,201,171,.72); }
html[data-theme="dark"] .dot.active{ background: rgba(95,240,208,.75); }

.footer{ margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(215,226,239,.85); }
html[data-theme="dark"] .footer{ border-top: 1px solid rgba(23,50,69,.55); }
.footerLine{ display:flex; gap:8px; align-items:center; font-size: 12px; color: var(--muted); }
.muted{ opacity:.85; }

/* Link */
.hsLink{
  color: rgba(7,16,24,.92);
  text-decoration: none;
  border-bottom: 1px solid rgba(18,201,171,.45);
  padding-bottom: 1px;
  transition: border-color .15s ease, color .15s ease, text-shadow .15s ease;
}
html[data-theme="dark"] .hsLink{
  color: rgba(233,242,255,.92);
  border-bottom: 1px solid rgba(95,240,208,.45);
}
.hsLink:hover{
  border-bottom-color: rgba(18,201,171,.85);
  color: rgba(7,16,24,.98);
  text-shadow: 0 0 18px rgba(18,201,171,.18);
}
html[data-theme="dark"] .hsLink:hover{
  border-bottom-color: rgba(95,240,208,.85);
  color: rgba(255,255,255,.98);
  text-shadow: 0 0 18px rgba(95,240,208,.25);
}
.hsLink:active{ opacity: .9; }

.modalBackdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(14px);
  display:none;
  z-index:50;
  padding: 18px 16px;
}
html[data-theme="dark"] .modalBackdrop{ background: rgba(0,0,0,.55); }
.modalBackdrop.show{ display:grid; place-items:center; }

.modal{
  width: min(620px, 100%);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  border:1px solid rgba(2,10,24,.08);
  box-shadow: var(--shadow);
  overflow:hidden;
}
html[data-theme="dark"] .modal{
  background: linear-gradient(180deg, rgba(11,23,35,.92), rgba(11,23,35,.72));
  border:1px solid rgba(255,255,255,.10);
}

.modalHeader{ padding: 18px 18px 0; }
.modalKicker{ color: rgba(18,201,171,.90); font-weight:800; letter-spacing:.2px; font-size:12px; }
html[data-theme="dark"] .modalKicker{ color: rgba(95,240,208,.90); }
.modalTitle{ margin: 6px 0 0; font-size: 20px; letter-spacing:-.2px; }
.modalSub{ margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height:1.4; }

.langGrid{
  padding: 16px 18px 10px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:12px;
}
.langBtn{
  border:1px solid rgba(2,10,24,.08);
  background: rgba(255,255,255,.70);
  color: var(--text);
  border-radius: 22px;
  padding: 14px 14px;
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  align-items:center;
  transition: transform .15s ease, border-color .15s ease;
}
html[data-theme="dark"] .langBtn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(7,16,24,.25);
}
.langBtn:hover{ border-color: rgba(18,201,171,.25); }
html[data-theme="dark"] .langBtn:hover{ border-color: rgba(95,240,208,.25); }
.langBtn:active{ transform: scale(.99); }
.langName{ font-weight:800; }
.langHint{ color: var(--muted); font-weight:800; }

.modalFooter{ padding: 10px 18px 18px; }
.miniNote{
  border:1px dashed rgba(2,10,24,.14);
  background: rgba(255,255,255,.70);
  border-radius: 18px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}
html[data-theme="dark"] .miniNote{
  border:1px dashed rgba(255,255,255,.14);
  background: rgba(7,16,24,.25);
}

.overlay{
  position:fixed;
  inset:0;
  background: rgba(247,250,252,.85);
  backdrop-filter: blur(16px);
  z-index:60;
  display:none;
  flex-direction:column;
}
html[data-theme="dark"] .overlay{ background: rgba(7,16,24,.85); }
.overlay.show{ display:flex; }

.overlayTop{
  padding: calc(12px + var(--safeTop)) 16px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom: 1px solid rgba(215,226,239,.85);
  background: linear-gradient(to bottom, rgba(247,250,252,.92), rgba(247,250,252,.35));
}
html[data-theme="dark"] .overlayTop{
  border-bottom: 1px solid rgba(23,50,69,.55);
  background: linear-gradient(to bottom, rgba(7,16,24,.88), rgba(7,16,24,.35));
}
.overlayTitle{ font-weight:900; letter-spacing:-.2px; }

.detailsBody{
  flex:1;
  padding: 12px 16px calc(16px + var(--safeBottom));
  display:flex;
  flex-direction:column;
  gap:12px;
}

.detailsCarousel{
  flex:1;
  display:flex;
  gap:14px;
  overflow:auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width:none;
}
.detailsCarousel::-webkit-scrollbar{ display:none; }

.detailSlide{
  flex:0 0 100%;
  scroll-snap-align:center;
  border-radius: 26px;
  border:1px solid rgba(2,10,24,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  box-shadow: var(--shadow);
  padding: 16px;
  overflow:hidden;
}
html[data-theme="dark"] .detailSlide{
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(11,23,35,.85), rgba(11,23,35,.65));
}
.detailH{
  font-size: 14px;
  margin:0;
  color: rgba(18,201,171,.90);
  letter-spacing:.2px;
  font-weight:900;
}
html[data-theme="dark"] .detailH{ color: rgba(95,240,208,.90); }
.detailText{
  margin: 10px 0 0;
  color: rgba(7,16,24,.90);
  line-height:1.6;
  font-size: 14px;
}
html[data-theme="dark"] .detailText{ color: rgba(233,242,255,.92); }
.detailList{
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height:1.7;
}
.detailList li{ margin: 6px 0; }

.detailsDots{ display:flex; justify-content:center; gap:8px; padding-bottom: 4px; }
.dDot{ width:7px;height:7px;border-radius:999px;background: rgba(61,86,111,.28); }
html[data-theme="dark"] .dDot{ background: rgba(180,198,221,.35); }
.dDot.active{ width:22px; background: rgba(47,124,255,.65); }
html[data-theme="dark"] .dDot.active{ background: rgba(109,166,255,.75); }

.sheetBackdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(10px);
  display:none;
  z-index:70;
}
html[data-theme="dark"] .sheetBackdrop{ background: rgba(0,0,0,.45); }
.sheetBackdrop.show{ display:block; }

.sheet{
  position:fixed;
  left:0; right:0;
  bottom: -100%;
  z-index:80;
  padding: 10px 16px calc(18px + var(--safeBottom));
}
.sheet.show{ bottom:0; }

.sheetHandle{
  width: 56px; height: 5px;
  background: rgba(61,86,111,.26);
  border-radius: 999px;
  margin: 0 auto 10px;
}
html[data-theme="dark"] .sheetHandle{ background: rgba(180,198,221,.35); }

.sheetHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}
.sheetKicker{ color: rgba(18,201,171,.90); font-weight:900; font-size:12px; }
html[data-theme="dark"] .sheetKicker{ color: rgba(95,240,208,.90); }
.sheetTitle{ font-weight:900; font-size: 18px; letter-spacing:-.2px; margin-top: 4px; }

.sheetCard{
  border-radius: 26px;
  border:1px solid rgba(2,10,24,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  box-shadow: var(--shadow);
  padding: 14px;
}
html[data-theme="dark"] .sheetCard{
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(11,23,35,.92), rgba(11,23,35,.72));
}
.docRow{ display:flex; align-items:center; gap:12px; }
.avatar{
  width:46px;height:46px;border-radius:16px;
  display:grid;place-items:center;
  background: rgba(18,201,171,.12);
  border:1px solid rgba(18,201,171,.22);
  font-weight:900;
}
html[data-theme="dark"] .avatar{
  background: rgba(95,240,208,.12);
  border:1px solid rgba(95,240,208,.22);
}
.docName{ font-weight:900; }
.docSpec{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.contactRow{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(2,10,24,.08);
  display:flex;
  justify-content:space-between;
  gap:12px;
}
html[data-theme="dark"] .contactRow{ border-top: 1px solid rgba(255,255,255,.08); }
.contactLabel{ color: var(--muted); font-size: 12px; }
.contactValue{ font-weight:900; letter-spacing:.2px; }

.sheetActions{ display:flex; gap:10px; margin-top: 12px; }
.toast{ margin-top: 10px; min-height: 18px; font-size: 12px; color: rgba(18,201,171,.90); }
html[data-theme="dark"] .toast{ color: rgba(95,240,208,.90); }

.sheetFoot{ margin-top: 10px; color: var(--muted); font-size: 12px; }

/* RTL support */
html[dir="rtl"] body{ font-family: "Noto Sans Arabic", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
html[dir="rtl"] .brand{ direction:ltr; }
html[dir="rtl"] .cardSub,
html[dir="rtl"] .qItem,
html[dir="rtl"] .detailText,
html[dir="rtl"] .detailList{ direction:rtl; }
html[dir="rtl"] .detailList{ padding-left:0; padding-right: 18px; }

/* Desktop layout tweaks */
@media (min-width: 960px){
  .shell{ padding-left: 22px; padding-right:22px; }
  .carousel{ padding-left: 6px; padding-right: 6px; }
  .card{ flex-basis: 460px; }
}
