/* «ابحث عن معلم» (10-21): شكل تطبيق موبايل — عمود في النص حتى على الكمبيوتر،
   رادار بيلف ويكتشف المدرسين، كروت مدوّرة، وشريط فلترة ثابت تحت. */
@font-face { font-family:Changa; src:url(/sites/Changa.ttf) format('truetype'); font-weight:200 800; font-display:swap; }
:root {
  --navy:#0E1F3D; --navy2:#1B3566; --teal:#14B8A6; --teal2:#5EEAD4; --gold:#FBBF24;
  --bg:#F3F5FA; --card:#fff; --ink:#111827; --sub:#5F6B80; --line:#E5E8F0; --r:22px;
}
* { box-sizing:border-box; margin:0; }
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
html, body { max-width:100%; overflow-x:hidden; }
@supports (overflow:clip) { html, body { overflow-x:clip; } }
body.fd { font-family:Cairo, Tahoma, sans-serif; color:var(--ink); line-height:1.6; -webkit-font-smoothing:antialiased;
  background:radial-gradient(60% 50% at 80% 0, rgba(20,184,166,.18), transparent 70%), radial-gradient(50% 50% at 0 100%, rgba(27,53,102,.16), transparent 70%), #E9EDF5; min-height:100vh; }
a { color:inherit; text-decoration:none; }
img { max-width:100%; }
h1, h2, h3, b, small, span, p { overflow-wrap:break-word; }
:focus-visible { outline:3px solid rgba(20,184,166,.6); outline-offset:2px; }

.fd-app { max-width:520px; margin:0 auto; min-height:100vh; background:var(--bg); position:relative; display:flex; flex-direction:column; box-shadow:0 0 0 1px rgba(14,31,61,.06), 0 30px 80px rgba(14,31,61,.16); }
@media (min-width: 560px) { .fd-app { margin:18px auto; min-height:calc(100vh - 36px); border-radius:32px; overflow:clip; } }

.fd-bar { position:sticky; top:0; z-index:30; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 16px; background:rgba(14,31,61,.92); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); color:#fff; }
.fd-brand { display:flex; align-items:center; gap:10px; min-width:0; }
.fd-logo { width:40px; height:40px; border-radius:13px; background:linear-gradient(140deg, #1B3566, #0B1730); display:grid; place-items:center; box-shadow:inset 0 0 0 1px rgba(94,234,212,.35); flex:none; }
.fd-logo svg { width:26px; height:26px; fill:none; stroke:var(--teal2); stroke-width:2.2; stroke-linecap:round; }
.fd-logo svg path { stroke:var(--gold); }
.fd-name { display:flex; flex-direction:column; min-width:0; line-height:1.2; }
.fd-name b { font:800 17px Changa, Cairo, sans-serif; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fd-name small { font-size:11.5px; color:rgba(255,255,255,.65); font-weight:700; }
.fd-teach { flex:none; font-weight:800; font-size:13px; padding:8px 13px; border-radius:99px; background:rgba(255,255,255,.1); box-shadow:inset 0 0 0 1px rgba(255,255,255,.18); }

/* الواجهة + الرادار */
.fd-hero { position:relative; padding:22px 18px 18px; text-align:center; color:#fff; background:radial-gradient(90% 70% at 50% 100%, #1B3566, #0E1F3D 70%); border-radius:0 0 32px 32px; overflow:hidden; }
.fd-hero h1 { font:800 clamp(24px, 6.4vw, 30px)/1.25 Changa, Cairo, sans-serif; }
.fd-sub { color:rgba(255,255,255,.78); font-size:14.5px; margin:8px auto 0; max-width:440px; }
.fd-hero-sm { padding-bottom:24px; }
.fd-hero-sm .fd-scan { margin-top:14px; }
.crumbs { display:flex; gap:6px; flex-wrap:wrap; justify-content:center; font-size:12.5px; color:rgba(255,255,255,.65); margin-bottom:8px; }
.crumbs a { color:var(--teal2); font-weight:700; }

.radar { --T:4.2s; position:relative; width:min(330px, 84vw); aspect-ratio:1; margin:18px auto 6px; border-radius:50%;
  background:radial-gradient(circle, rgba(94,234,212,.10) 0, rgba(94,234,212,.04) 45%, transparent 70%), radial-gradient(circle at 50% 50%, #12305C, #0A1A35 72%);
  box-shadow:0 0 0 1px rgba(94,234,212,.25), 0 0 60px rgba(20,184,166,.25), inset 0 0 40px rgba(0,0,0,.35); }
.r-ring { position:absolute; border-radius:50%; border:1px solid rgba(94,234,212,.22); inset:0; margin:auto; }
.r1 { width:33%; height:33%; } .r2 { width:66%; height:66%; } .r3 { width:99%; height:99%; border-style:dashed; border-color:rgba(94,234,212,.15); }
.r-cross { position:absolute; inset:0; background:linear-gradient(rgba(94,234,212,.12), rgba(94,234,212,.12)) center / 1px 100% no-repeat, linear-gradient(90deg, rgba(94,234,212,.12), rgba(94,234,212,.12)) center / 100% 1px no-repeat; border-radius:50%; }
.r-sweep { position:absolute; inset:0; border-radius:50%; background:conic-gradient(from 0deg, transparent 0deg 285deg, rgba(94,234,212,.04) 300deg, rgba(94,234,212,.22) 345deg, rgba(94,234,212,.55) 359deg, transparent 360deg); will-change:transform; }
.radar.scan .r-sweep { animation:fd-sweep var(--T) linear infinite; }
.r-me { position:absolute; left:50%; top:50%; width:40px; height:40px; margin:-20px 0 0 -20px; border-radius:50%; display:grid; place-items:center; background:var(--teal); color:#062B27; box-shadow:0 0 0 6px rgba(20,184,166,.18), 0 0 24px rgba(20,184,166,.6); z-index:2; }
.r-me svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; stroke-linejoin:round; }
.bub { position:absolute; width:46px; height:46px; margin:-23px 0 0 -23px; padding:0; border:0; background:none; border-radius:50%; cursor:pointer; z-index:3; opacity:1; }
.bub-in { display:grid; place-items:center; width:100%; height:100%; border-radius:50%; overflow:hidden; background:linear-gradient(140deg, #fff, #CFFAF3); color:var(--navy); font:800 19px Changa, Cairo, sans-serif; box-shadow:0 0 0 2px var(--teal2), 0 0 16px rgba(94,234,212,.7); }
.bub-in img { width:100%; height:100%; object-fit:cover; display:block; }
.bub.is-feat .bub-in { box-shadow:0 0 0 2px var(--gold), 0 0 18px rgba(251,191,36,.75); }
.radar.scan .bub { animation:fd-appear .45s ease-out var(--dl) both; }
.radar.scan .bub-in { animation:fd-ping var(--T) linear var(--dl) infinite; }
.bub[hidden] { display:none; }
.r-status { font-size:13.5px; font-weight:700; color:var(--teal2); min-height:22px; }
@keyframes fd-sweep { to { transform:rotate(360deg); } }
@keyframes fd-appear { from { opacity:0; transform:scale(.2); } to { opacity:1; transform:scale(1); } }
@keyframes fd-ping { 0% { transform:scale(1.22); filter:brightness(1.25); } 18% { transform:scale(1); filter:none; } 100% { transform:scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .radar.scan .r-sweep, .radar.scan .bub, .radar.scan .bub-in { animation:none; }
  .r-sweep { background:conic-gradient(from 0deg, transparent 0deg 300deg, rgba(94,234,212,.2) 360deg); }
}

/* النتايج */
.fd-list { padding:16px 14px 24px; flex:1; }
.fd-head { display:flex; flex-direction:column; gap:2px; margin-bottom:12px; }
.rcount { font-weight:800; font-size:15px; }
.featnote { font-size:12px; color:var(--sub); font-weight:600; margin-bottom:6px; }
.cards { display:grid; grid-template-columns:minmax(0, 1fr); gap:12px; }
.tcard { background:var(--card); border-radius:var(--r); padding:14px; display:flex; flex-direction:column; gap:12px; position:relative; box-shadow:0 1px 0 var(--line), 0 10px 26px rgba(14,31,61,.06); animation:fd-rise .35s ease-out both; }
.tcard[hidden] { display:none; }
@keyframes fd-rise { from { transform:translateY(8px); } }
.tcard .th { display:flex; gap:12px; align-items:center; min-width:0; }
.tav { width:62px; height:62px; border-radius:18px; object-fit:cover; flex:none; background:linear-gradient(140deg, #E6F7F4, #D6E4FF); color:var(--navy2); display:grid; place-items:center; font:800 26px Changa, Cairo, sans-serif; }
.tm { min-width:0; flex:1; }
.tcard h3 { font:800 16.5px/1.4 Changa, Cairo, sans-serif; padding-inline-end:58px; }
.tcard small { display:block; color:var(--sub); font-size:13px; line-height:1.6; }
.chips { display:flex; flex-wrap:wrap; gap:5px; margin-top:5px; }
.chips span { background:#EEF2FA; color:var(--navy2); font-size:11.5px; font-weight:800; padding:2px 9px; border-radius:99px; }
.chips .md { background:#E6F7F4; color:#0F766E; }
.chips .rch { background:#FEF3C7; color:#92400E; }
.feat::before { content:'⭐ '; }
.feat { position:absolute; top:12px; left:12px; background:linear-gradient(135deg, #FBBF24, #F59E0B); color:#3B2600; font-size:11.5px; font-weight:800; padding:3px 9px; border-radius:99px; }
.tb { display:flex; gap:8px; }
.fbtn { flex:1 1 0; display:inline-flex; align-items:center; justify-content:center; gap:6px; min-width:0; padding:10px 12px; border-radius:14px; font:800 14px Cairo, sans-serif; border:0; cursor:pointer; white-space:nowrap; transition:transform .15s; }
.fbtn:active { transform:scale(.96); }
.fbtn.p { background:var(--navy); color:#fff; } .fbtn.wa { background:#25D366; color:#fff; } .fbtn.o { background:#fff; color:var(--navy); box-shadow:inset 0 0 0 1.5px var(--navy); }
.fd-hero .fbtn.p { background:var(--teal); color:#062B27; display:inline-flex; flex:none; padding:10px 18px; }

.empty { background:var(--card); border-radius:var(--r); padding:22px 16px; text-align:center; box-shadow:0 1px 0 var(--line); margin-bottom:12px; }
.empty-ic { font-size:34px; } .empty p { font-weight:700; margin-top:4px; }
.near { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:12px; }
.near a { background:#EEF2FA; color:var(--navy2); font-weight:800; padding:7px 13px; border-radius:99px; font-size:13.5px; }
.near a span { color:var(--sub); margin-inline-start:6px; }

.dsec { margin-top:16px; }
.dsec h2 { font:800 18px Changa, Cairo, sans-serif; display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.dsec h2 a { font:800 13px Cairo, sans-serif; color:var(--teal); }

/* شريط الفلترة تحت */
.fd-filter { position:sticky; bottom:0; z-index:25; display:flex; gap:8px; overflow-x:auto; scrollbar-width:none; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); background:rgba(255,255,255,.94); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); box-shadow:0 -10px 30px rgba(14,31,61,.1); border-radius:22px 22px 0 0; margin-top:auto; }
.fd-filter::-webkit-scrollbar { display:none; }
.sel { flex:none; display:flex; flex-direction:column; background:#F1F4FA; border-radius:14px; padding:5px 10px 4px; min-width:110px; max-width:170px; }
.sel[hidden] { display:none; }
.sel span { font-size:10.5px; font-weight:800; color:var(--sub); }
.sel select { border:0; background:transparent; font:800 14px Cairo, sans-serif; color:var(--ink); padding:0; outline:none; max-width:100%; }

/* كارت المدرس من تحت (bottom sheet) */
.sheet { position:fixed; inset:0; z-index:60; }
.sheet[hidden] { display:none; }
.sheet-bg { position:absolute; inset:0; background:rgba(8,15,30,.45); opacity:0; transition:opacity .2s; }
.sheet-card { position:absolute; left:50%; bottom:0; width:min(520px, 100%); transform:translate(-50%, 100%); background:var(--bg); border-radius:26px 26px 0 0; padding:12px 14px calc(18px + env(safe-area-inset-bottom)); transition:transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow:0 -20px 60px rgba(8,15,30,.3); }
.sheet.open .sheet-bg { opacity:1; } .sheet.open .sheet-card { transform:translate(-50%, 0); }
.sheet-grip { display:block; width:42px; height:5px; border-radius:9px; background:#CBD2E0; margin:0 auto 10px; }
.sheet-x { position:absolute; z-index:2; top:-14px; left:14px; box-shadow:0 4px 14px rgba(8,15,30,.2); width:34px; height:34px; border-radius:50%; border:0; background:#E4E8F1; font:800 20px/1 Cairo, sans-serif; cursor:pointer; color:var(--ink); }
.sheet .tcard { animation:none; box-shadow:none; }

.fd-foot { padding:18px 16px 90px; color:var(--sub); font-size:13px; line-height:1.9; text-align:center; }
.fd-foot a { color:var(--navy2); font-weight:800; }
.fd-cta { display:inline-block; margin-bottom:8px; background:var(--navy); color:#fff !important; padding:10px 18px; border-radius:99px; }

@media (max-width: 360px) { .fd-teach { display:none; } .tcard h3 { padding-inline-end:0; } .feat { position:static; align-self:flex-start; } }
@media print { .fd-filter, .sheet, .radar, .fd-bar { display:none !important; } .fd-app { box-shadow:none; } }
