/* مدرس الموسم 2026 — ثيم لايت (خلفية بيضاء) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');

/* ثيم لايت فقط — منع الوضع الداكن */
html { background-color: #ffffff !important; background: #ffffff !important; color-scheme: light; }
body { background-color: #ffffff !important; background: #ffffff !important; }

:root {
  color-scheme: light;
  --primary: #A00060;
  --primary-hover: #C20078;
  --primary-light: rgba(160, 0, 96, 0.1);
  --primary-glow: rgba(194, 0, 120, 0.18);
  --dark: #6b0a48;
  --bg: #ffffff;
  --bg-elevated: #f8f6f8;
  --bg-card: #ffffff;
  --card-border: rgba(160, 0, 96, 0.12);
  --white: #ffffff;
  --text: #2d2d2d;
  --muted: #5c5c5c;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 24px rgba(160, 0, 96, 0.15);
  --transition: 0.2s ease;
  --touch: 44px;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Tajawal', 'Plus Jakarta Sans', sans-serif;
  background: #ffffff;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* شاشة التحميل — خلفية بيضاء */
#page-loader {
  position: fixed;
  inset: 0;
  background: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
#page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.loader-spinner {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(160, 0, 96, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loader-text { margin-top: 1rem; color: var(--text); font-size: 1rem; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }

/* الهيدر */
.site-header {
  background: #ffffff;
  padding: 0.6rem 1rem;
  padding-top: calc(0.6rem + var(--safe-top));
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 0 rgba(160, 0, 96, 0.06);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.site-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
}
.site-logo:hover { color: var(--primary); text-decoration: none; }
.site-logo:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.nav-toggle {
  display: none;
  width: var(--touch);
  height: var(--touch);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: auto;
}
.nav-toggle:hover { background: var(--primary-light); }
.nav-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.nav-toggle .hamburger-inner { display: flex; flex-direction: column; justify-content: space-between; height: 18px; width: 22px; }
.nav-toggle .hamburger-inner span { display: block; width: 100%; height: 2px; background: currentColor; border-radius: 1px; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] .hamburger-inner span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger-inner span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .hamburger-inner span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  transition: background var(--transition), color var(--transition);
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  font-size: 0.9rem;
}
.nav-links a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.nav-suggest .nav-plus { display: inline-block; width: 1.1em; height: 1.1em; line-height: 1; text-align: center; font-weight: 700; margin-left: 0.25rem; }

/* المحتوى */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  flex: 1;
  width: 100%;
  padding-bottom: calc(1.5rem + var(--safe-bottom));
}

/* Hero */
.hero {
  text-align: center;
  padding: 2rem 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
}
.hero .hero-title {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}
.hero .hero-title .gradient {
  color: var(--primary);
}
.hero .hero-desc { color: var(--muted); font-size: 1rem; max-width: 460px; margin: 0 auto; line-height: 1.55; }
.hero .hero-line { width: 56px; height: 3px; background: var(--primary); margin: 1rem auto 0; border-radius: var(--radius-pill); opacity: 0.9; }

/* Hero ثلاثي: تليجرام | العنوان | Wezary */
.hero-three { padding: 1.5rem 1rem 2rem; }
.hero-three .hero-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}
.hero-three .hero-center { text-align: center; order: 2; }
.hero-three .hero-side { display: flex; align-items: center; justify-content: center; }
.hero-three .hero-side-telegram { order: 1; justify-content: flex-end; }
.hero-three .hero-side-brand { order: 3; justify-content: flex-start; }

/* صندوق تليجرام — ستايل شبيه بتليجرام */
.hero-telegram-box {
  background: linear-gradient(180deg, #f4f4f5 0%, #e8e8eb 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  min-width: 160px;
}
.hero-telegram-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
  font-weight: 600;
}
.hero-telegram-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-telegram-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-telegram-btn {
  display: inline-block;
  background: #0088cc;
  color: #fff !important;
  text-decoration: none !important;
  padding: 0.55rem 1.1rem;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 1px 3px rgba(0, 136, 204, 0.35);
}
.hero-telegram-btn:hover {
  background: #0077b5;
  transform: scale(1.03);
  color: #fff !important;
  text-decoration: none !important;
}
.hero-telegram-placeholder .hero-telegram-muted { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }

/* صندوق العلامة Wezary / أوائل العراق */
.hero-brand-box {
  text-align: center;
  padding: 0.75rem 1rem;
}
.hero-brand-wezary {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}
.hero-brand-awail {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.page-title { font-size: clamp(1.35rem, 3vw, 1.6rem); font-weight: 800; color: var(--text); margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.page-title .accent { color: var(--primary); }
.section-title { color: var(--muted); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin: 1.5rem 0 0.75rem; }

/* مبدّل نوع المنهج (عربي / إنجليزي) */
.curriculum-switcher-wrap {
  margin: 1.5rem 0 1rem;
  text-align: center;
}
.curriculum-switcher {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
}
.curriculum-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid var(--card-border);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
  min-height: var(--touch);
}
.curriculum-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}
.curriculum-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-glow);
}
.curriculum-btn.active:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--white);
  text-decoration: none;
}
.curriculum-btn-icon {
  font-size: 1.25rem;
  line-height: 1;
}
.curriculum-btn-text {
  letter-spacing: 0.02em;
}
.curriculum-switcher-hint {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* شبكة المواد — 8 مواد بدون مادة وحيدة في سطر (8 | 6+2 | 4+4 | 3+3+2 | 2×4 | 1×8) */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
}
.subject-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text);
  padding: 1rem 0.75rem;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--card-border);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 92px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--transition);
}
.subject-card:hover { border-color: rgba(160, 0, 96, 0.35); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.subject-card:hover::before { opacity: 1; }
.subject-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.subject-card .subject-icon { width: 32px; height: 32px; margin-bottom: 0.4rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.subject-card .subject-icon .subject-icon-img,
.subject-card .subject-icon img { width: 26px; height: 26px; object-fit: contain; display: block; filter: brightness(0) saturate(100%); }
.subject-card .subject-name { font-weight: 600; font-size: 0.95rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.subject-card .subject-count {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  min-width: 1.8em;
  display: inline-block;
}
.subject-icon-lg { display: inline-flex; align-items: center; margin-left: 0.5rem; vertical-align: middle; }
.subject-icon-lg .subject-icon-img,
.subject-icon-lg img { width: 28px; height: 28px; object-fit: contain; display: block; filter: brightness(0) saturate(100%); }

/* شبكة المدرسين — بطاقة موحدة (صفحة المادة + جميع المدرسين) */
.teachers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.teacher-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.teacher-card.hidden { display: none !important; }
.teacher-card:hover { box-shadow: var(--shadow); border-color: rgba(160, 0, 96, 0.35); }
.teacher-card a {
  color: inherit;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 100px;
  text-decoration: none;
  padding: 0;
  gap: 0;
}
.teacher-card a:hover { text-decoration: none; }
.teacher-card-photo {
  flex-shrink: 0;
  width: 100px;
  min-width: 100px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg-elevated);
  overflow: hidden;
  border: 2px solid var(--card-border);
  margin: 0.5rem;
  align-self: center;
}
.teacher-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}
.teacher-card:hover .teacher-card-photo img { transform: scale(1.05); }
.teacher-card-body {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  text-align: right;
  border-left: 1px solid var(--card-border);
}
.teacher-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}
.teacher-card-rank {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  width: fit-content;
  margin-right: auto;
}
.teacher-card-meta {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}
.teacher-card-subject-rank {
  font-size: 0.8rem;
  color: var(--muted);
}
.teacher-card-votes {
  margin-top: 0.25rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}
.teacher-card-votes-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }

/* بحث جميع المدرسين */
.teachers-search-wrap {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.teachers-search-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}
.teachers-search-input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  padding: 0.6rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--transition);
}
.teachers-search-input:focus {
  outline: none;
  border-color: var(--primary);
}
.teachers-search-input::placeholder { color: var(--muted); }
.teachers-search-result { font-size: 0.85rem; color: var(--primary); font-weight: 600; }
.teachers-search-empty { color: var(--muted); margin-top: 1rem; }
.teachers-empty { color: var(--muted); }
.hidden { display: none !important; }

/* أعلى 3 على الموقع — منصة بتباعد ثابت */
.top-teachers.podium-site {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  align-items: end;
  justify-items: center;
  margin: 2rem auto;
  max-width: 720px;
  padding: 0 0.75rem;
}
.podium-site .podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: transparent;
  border: none;
  padding: 0 0.25rem;
  width: 100%;
  max-width: 200px;
  min-height: 280px;
  transition: transform var(--transition);
}
.podium-site .podium-item:hover { transform: translateY(-4px); }
.podium-site .podium-2 { order: 1; min-height: 240px; }
.podium-site .podium-1 { order: 2; min-height: 320px; max-width: 220px; }
.podium-site .podium-3 { order: 3; min-height: 200px; }
.podium-crown { font-size: 0.68rem; font-weight: 800; margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary); }
.podium-crown-silver { color: #6b7280; }
.podium-crown-bronze { color: #92400e; }
.podium-thumb { width: 64px; height: 64px; margin: 0.3rem auto; border-radius: 50%; overflow: hidden; background: var(--bg-elevated); border: 2px solid var(--card-border); display: block; flex-shrink: 0; }
.podium-site .podium-1 .podium-thumb { width: 84px; height: 84px; border-color: rgba(212, 175, 55, 0.5); }
.podium-thumb img { width: 100%; height: 100%; object-fit: cover; }
.podium-name { font-weight: 700; font-size: 0.88rem; margin: 0.15rem 0; display: block; line-height: 1.3; }
.podium-site .podium-1 .podium-name { font-size: 1rem; }
.podium-subject { color: var(--primary); font-size: 0.75rem; font-weight: 600; }
.podium-votes { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.35rem; }
.podium-footer {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.podium-site .podium-footer .btn-primary { margin-top: 0; font-size: 0.75rem; padding: 0.35rem 0.75rem; }
.podium-step {
  width: 100%;
  min-height: 56px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0eef2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.podium-step-1 { min-height: 80px; background: #fdf6e8; }
.podium-step-2 { min-height: 64px; background: #f0f1f3; }
.podium-step-3 { min-height: 44px; background: #f5ebe4; }
.podium-num { font-size: 2rem; font-weight: 900; line-height: 1; color: inherit; }
.podium-step-1 .podium-num { color: #b8860b; font-size: 2.5rem; }
.podium-step-2 .podium-num { color: #5f6b7a; font-size: 2.1rem; }
.podium-step-3 .podium-num { color: #8b6914; font-size: 1.75rem; }

/* أعلى 3 في المادة */
.subject-top3 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0 1.25rem;
  justify-content: center;
}
.subject-top3-item {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  min-width: 180px;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.subject-top3-item:hover { border-color: var(--primary); box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.subject-top3-medal {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-weight: 800;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.subject-top3-thumb { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--bg-elevated); }
.subject-top3-thumb img { width: 100%; height: 100%; object-fit: cover; }
.subject-top3-name { font-weight: 700; font-size: 0.9rem; flex: 1; min-width: 0; }
.subject-top3-votes { font-size: 0.78rem; color: var(--primary); font-weight: 600; }

/* صفحة المدرس */
.teacher-profile {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}
.teacher-profile .cover { padding: 1.5rem 1.25rem; text-align: center; }
.teacher-profile .photo-wrap {
  width: 140px;
  height: 140px;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 1px var(--card-border), 0 6px 20px rgba(160, 0, 96, 0.12);
}
.teacher-profile .photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.teacher-profile .name { font-size: 1.35rem; margin-bottom: 0.2rem; font-weight: 800; letter-spacing: -0.02em; }
.teacher-profile .subject-name { color: var(--primary); margin-bottom: 0.4rem; font-size: 0.95rem; font-weight: 600; }
.teacher-profile .stats { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin: 0.85rem 0; }
.teacher-profile .stat { background: var(--bg-elevated); padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.9rem; border: 1px solid var(--card-border); }
.teacher-profile .links {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}
.teacher-profile .links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  transition: background var(--transition), color var(--transition);
  min-height: 38px;
  border: 1px solid var(--card-border);
}
.teacher-profile .links a:hover { background: var(--primary); color: var(--white); border-color: var(--primary); text-decoration: none; }
.teacher-profile .links a.social-link { display: inline-flex; align-items: center; gap: 0.45rem; }
.teacher-profile .links a.social-link svg { flex-shrink: 0; }
.profile-actions { padding: 0 1.25rem 0.85rem; text-align: center; }
.profile-actions .share-btn { min-height: var(--touch); }
.google-signin-wrap {
  margin-top: 0.6rem;
  display: inline-block;
  padding: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(160, 0, 96, 0.08);
}
.google-signin-wrap > div { display: inline-block; }
.google-signin-wrap iframe { border-radius: 8px !important; }
.vote-transfer-msg { margin: 0.6rem 0; }
.vote-transfer-msg a { color: var(--primary-hover); font-weight: 600; }

.back-wrap { margin-top: 1rem; }

/* قسم التعليقات */
section.comments-section {
  max-width: 640px;
  margin: 1.75rem auto 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--card-border);
}
section.comments-section .comments-title { font-size: 1.2rem; margin-bottom: 0.85rem; color: var(--text); font-weight: 700; }
section.comments-section .comments-toolbar { margin-bottom: 0.85rem; }
section.comments-section .comments-sort-label { font-size: 0.88rem; color: var(--muted); }
section.comments-section .comments-sort {
  margin-right: 0.5rem;
  padding: 0.4rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  min-height: 36px;
}
section.comments-section .comment-form-wrap { margin-bottom: 1.25rem; }
section.comments-section .comment-input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 88px;
}
section.comments-section .comment-input:focus { outline: none; border-color: var(--primary); }
section.comments-section .comment-submit { margin-top: 0.5rem; min-height: var(--touch); }
section.comments-section .comment-char-count { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
section.comments-section .comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 50px;
}
section.comments-section .comments-loading,
section.comments-section .comments-empty,
section.comments-section .comments-error {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.85rem 0;
}
section.comments-section .comments-load-more-wrap { text-align: center; padding: 1rem 0; }
section.comments-section .comments-load-more { min-height: var(--touch); padding: 0.6rem 1.25rem; font-size: 0.9rem; }
section.comments-section .comment-item {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(160, 0, 96, 0.06);
}
section.comments-section .comment-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 2px solid var(--card-border);
}
section.comments-section .comment-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
section.comments-section .comment-body-wrap { flex: 1; min-width: 0; }
section.comments-section .comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.35rem;
}
section.comments-section .comment-author { font-weight: 700; font-size: 1rem; color: var(--text); }
section.comments-section .comment-date { font-size: 0.78rem; color: var(--muted); }
section.comments-section .comment-text {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
section.comments-section .comment-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
section.comments-section .comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  min-height: 32px;
}
section.comments-section .comment-like-btn:hover,
section.comments-section .comment-like-btn.liked { color: var(--primary); }
section.comments-section .comment-heart { flex-shrink: 0; }
section.comments-section .comment-report-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  text-decoration: underline;
}
section.comments-section .comment-report-btn:hover { color: var(--primary); }

.vote-btn {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 1rem;
  margin: 0.85rem 0;
  min-height: var(--touch);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  font-weight: 700;
}
.vote-btn:hover { background: var(--primary-hover); transform: scale(1.02); box-shadow: var(--shadow-glow); }
.vote-btn:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.vote-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.vote-btn.voted { background: var(--bg-elevated); color: var(--text); cursor: default; border: 1px solid var(--card-border); }
a.vote-telegram-btn { text-decoration: none; color: var(--white); }
a.vote-telegram-btn:hover { color: var(--white); text-decoration: none; }
section.comments-section .comment-login-wrap { margin-bottom: 1.25rem; }
section.comments-section .comment-login-wrap .alert { margin-bottom: 0.5rem; }
section.comments-section .google-signin-comments { margin-top: 0.5rem; }


/* الفوتر */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--card-border);
  margin-top: 2.5rem;
  padding: 1.5rem 1rem;
  padding-bottom: calc(1.5rem + var(--safe-bottom));
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}
.site-footer .footer-brand { font-weight: 600; color: var(--text); }
.site-footer .footer-links { margin-top: 0.6rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.site-footer .footer-links a { color: var(--primary); font-weight: 500; min-height: var(--touch); display: inline-flex; align-items: center; }
.site-footer .footer-links a:hover { text-decoration: underline; }
.site-footer .footer-credits {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}
.site-footer .footer-credits a { color: var(--primary); font-weight: 600; }
.site-footer .footer-credits a:hover { text-decoration: underline; }

/* نماذج */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; color: var(--text); font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: var(--touch);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--muted); }
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.95rem;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  font-weight: 700;
}
.btn-primary:hover { background: var(--primary-hover); transform: scale(1.02); box-shadow: var(--shadow-glow); }
.btn-primary:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-delete { background: rgba(200, 60, 60, 0.12); color: #b91c1c; border: 1px solid rgba(200, 60, 60, 0.4); padding: 0.4rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.88rem; text-decoration: none; transition: background 0.2s, color 0.2s; }
.btn-delete:hover { background: rgba(200, 60, 60, 0.2); color: #991b1b; text-decoration: none; }
.btn-small { display: inline-block; padding: 0.35rem 0.6rem; font-size: 0.82rem; border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text); border: 1px solid var(--card-border); text-decoration: none; margin-left: 0.25rem; }
.btn-small:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-danger { background: rgba(200, 60, 60, 0.12); border-color: rgba(200, 60, 60, 0.4); color: #b91c1c; }
.btn-danger:hover { background: rgba(200, 60, 60, 0.2); color: #991b1b; border-color: rgba(200, 60, 60, 0.6); }
.admin-form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.admin-form-inline input[type="number"], .admin-form-inline input[type="text"] { padding: 0.5rem 0.7rem; max-width: 180px; }
.comment-hidden { opacity: 0.7; background: rgba(160, 0, 96, 0.06); }

/* جداول لوحة التحكم (صفحة المدرسين وغيرها) */
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--bg-card); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th, .data-table td { padding: 0.65rem 0.9rem; text-align: right; border-bottom: 1px solid var(--card-border); }
.data-table th { background: var(--bg-elevated); font-weight: 700; color: var(--text); }
.data-table tbody tr:hover { background: var(--primary-light); }
.data-table a { color: var(--primary); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.data-table .thumb { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius-sm); display: block; border: 1px solid var(--card-border); }

.g-recaptcha { margin: 0.5rem 0; }
.g-recaptcha > div { margin: 0 auto; }

.alert { padding: 0.9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; font-size: 0.95rem; }
.alert-success { background: rgba(0, 200, 100, 0.12); border: 1px solid rgba(0, 200, 100, 0.35); color: #166534; }
.alert-error { background: rgba(220, 60, 60, 0.12); border: 1px solid rgba(220, 60, 60, 0.35); color: #b91c1c; }
.alert-info { background: var(--primary-light); border: 1px solid var(--card-border); color: var(--text); }

.back-link { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--primary); min-height: var(--touch); font-weight: 500; }
.back-link:hover { color: var(--primary-hover); }
.error-page { text-align: center; padding: 2.5rem 1rem; }
.error-page .page-title { font-size: clamp(3rem, 12vw, 4rem); margin-bottom: 0.5rem; }
.error-page .section-title { margin: 1rem 0 1.25rem; }

/* ========== متجاوب — هاتف أولاً ========== */
@media (max-width: 992px) {
  .header-inner { position: relative; }
  .nav-toggle { display: flex; flex-direction: column; justify-content: center; }
  #main-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 50;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.6rem;
    flex-direction: column;
    gap: 0.15rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { width: 100%; justify-content: center; padding: 0.75rem; border-radius: var(--radius-sm); min-height: var(--touch); }
  .main-content { padding: 1.25rem 1rem; }
  .hero-three .hero-inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    text-align: center;
  }
  .hero-three .hero-center { order: 1; }
  .hero-three .hero-side-telegram { order: 2; justify-content: center; }
  .hero-three .hero-side-brand { order: 3; justify-content: center; }
  .hero-telegram-box { min-width: 0; }
  .hero-brand-box { padding: 0.5rem 0; }
  .hero { padding: 1.75rem 0.75rem 1.25rem; }
  .subjects-grid { grid-template-columns: repeat(6, 1fr); gap: 0.7rem; }
  .top-teachers.podium-site { max-width: 100%; padding: 0 0.5rem; }
  .podium-site .podium-1 .podium-thumb { width: 76px; height: 76px; }
  .podium-thumb { width: 58px; height: 58px; }
}

@media (max-width: 768px) {
  .hero-three { padding: 1.25rem 0.75rem 1.5rem; }
  .hero-three .hero-inner { gap: 1rem; }
  .hero-telegram-box { padding: 1rem 1.25rem; }
  .hero-telegram-logo { width: 48px; height: 48px; margin-bottom: 0.65rem; }
  .hero-brand-wezary { font-size: 0.85rem; }
  .hero-brand-awail { font-size: 0.95rem; }
  .subjects-grid { grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
  .main-content { padding: 1rem 0.85rem; }
  .page-title { font-size: 1.3rem; }
  .hero .hero-title { font-size: 1.5rem; }
  .hero .hero-desc { font-size: 0.95rem; }
  .subjects-grid { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
  .subject-card { padding: 0.85rem 0.6rem; min-height: 84px; }
  .subject-card .subject-icon { width: 28px; height: 28px; }
  .subject-card .subject-icon .subject-icon-img,
  .subject-card .subject-icon img { width: 22px; height: 22px; }
  .subject-card .subject-count { font-size: 0.75rem; padding: 0.15rem 0.4rem; }
  .teachers-grid { gap: 0.65rem; }
  .teacher-card a { min-height: 88px; }
  .teacher-card-photo { width: 80px; min-width: 80px; }
  .teacher-card-body { padding: 0.6rem 0.85rem; }
  .teacher-card-name { font-size: 1rem; }
  .teacher-card-votes { font-size: 0.95rem; }
  .teacher-card-meta, .teacher-card-subject-rank { font-size: 0.78rem; }
  .teachers-search-wrap { margin-bottom: 0.85rem; }
  .teachers-search-input { max-width: 100%; }
  /* منصة أعلى 3 — عمود واحد بتباعد ثابت على الهاتف */
  .top-teachers.podium-site {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-width: 260px;
    margin-right: auto;
    margin-left: auto;
    padding: 0 0.5rem;
  }
  .podium-site .podium-item {
    min-height: auto;
    max-width: 100%;
    padding: 0.5rem 0;
  }
  .podium-site .podium-2 { order: 2; min-height: auto; }
  .podium-site .podium-1 { order: -1; min-height: auto; max-width: 100%; }
  .podium-site .podium-3 { order: 3; min-height: auto; }
  .podium-site .podium-1 .podium-thumb { width: 72px; height: 72px; }
  .podium-thumb { width: 56px; height: 56px; }
  .podium-step-1 { min-height: 60px; }
  .podium-step-2 { min-height: 48px; }
  .podium-step-3 { min-height: 40px; }
  .podium-step-1 .podium-num { font-size: 2rem; }
  .podium-step-2 .podium-num { font-size: 1.75rem; }
  .podium-step-3 .podium-num { font-size: 1.5rem; }
  .podium-name { font-size: 0.85rem; }
  .podium-site .podium-1 .podium-name { font-size: 0.95rem; }
  .teacher-profile .cover { padding: 1.1rem 1rem; }
  .teacher-profile .photo-wrap { width: 110px; height: 110px; margin-bottom: 0.65rem; border-width: 3px; }
  .teacher-profile .name { font-size: 1.15rem; }
  .teacher-profile .stats { flex-direction: column; align-items: center; gap: 0.5rem; }
  .teacher-profile .links { padding: 0.85rem 1rem; gap: 0.4rem; }
  .teacher-profile .links a { padding: 0.4rem 0.75rem; font-size: 0.82rem; min-height: 36px; }
  .profile-actions { padding: 0 1rem 0.65rem; }
  section.comments-section { padding: 1rem 0; margin-top: 1.25rem; }
  section.comments-section .comment-item { padding: 0.85rem; gap: 0.85rem; }
  section.comments-section .comment-avatar { width: 42px; height: 42px; }
  section.comments-section .comment-author { font-size: 0.92rem; }
  section.comments-section .comment-text { font-size: 0.88rem; }
  section.comments-section .comment-actions { gap: 0.4rem; }
  .subject-top3 { gap: 0.5rem; margin: 0.5rem 0 1rem; }
  .subject-top3-item { min-width: 100%; padding: 0.6rem 0.8rem; }
  .subject-top3-thumb { width: 36px; height: 36px; }
  .subject-top3-name { font-size: 0.88rem; }
  /* كروت المدرسين موبايل */
  .teacher-card a { min-height: 82px; }
  .teacher-card-photo { width: 72px; min-width: 72px; }
  .teacher-card-body { padding: 0.55rem 0.75rem; gap: 0.25rem; }
  .teacher-card-name { font-size: 0.95rem; }
  .teacher-card-votes { font-size: 0.9rem; margin-top: 0.2rem; }
  .site-footer { padding: 1.25rem 0.85rem; margin-top: 2rem; }
  .site-footer .footer-credits { margin-top: 0.85rem; padding-top: 0.75rem; font-size: 0.72rem; }
  .site-footer .footer-links { gap: 0.75rem; }
}

@media (max-width: 576px) {
  .subjects-grid { grid-template-columns: repeat(2, 1fr); gap: 0.55rem; }
}

@media (max-width: 480px) {
  .site-header { padding: 0.5rem 0.85rem; padding-top: calc(0.5rem + var(--safe-top)); }
  .site-logo { font-size: 1.05rem; }
  .main-content { padding: 0.85rem 0.65rem; }
  .hero { padding: 1.25rem 0.5rem 1rem; }
  .hero .hero-title { font-size: 1.35rem; }
  .page-title { font-size: 1.2rem; }
  .subjects-grid { grid-template-columns: repeat(2, 1fr); gap: 0.55rem; }
  .subject-card { min-height: 78px; padding: 0.75rem 0.6rem; }
  .subject-card .subject-name { font-size: 0.9rem; }
  .teachers-grid { gap: 0.6rem; }
  .teacher-card-photo { width: 64px; min-width: 64px; }
  .teacher-card-body { padding: 0.5rem 0.65rem; }
  .teacher-card-name { font-size: 0.9rem; }
  .teacher-card-votes { font-size: 0.85rem; }
  .teacher-card-rank, .teacher-card-meta, .teacher-card-subject-rank { font-size: 0.75rem; }
  .teacher-profile .photo-wrap { width: 96px; height: 96px; }
  .teacher-profile .name { font-size: 1.05rem; }
  .form-group input, .form-group textarea, .form-group select { padding: 0.65rem 0.8rem; }
  .vote-btn { padding: 0.6rem 1.2rem; font-size: 0.95rem; }
  .btn-primary { padding: 0.65rem 1.2rem; font-size: 0.9rem; }
  .site-footer .footer-links { flex-direction: column; align-items: center; }
  .site-footer .footer-credits { font-size: 0.7rem; }
}

@media (max-width: 360px) {
  .subjects-grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .top-teachers.podium-site { max-width: 100%; }
  .teacher-profile .links a { font-size: 0.78rem; padding: 0.35rem 0.6rem; }
}

@media (hover: none) {
  .subject-card:hover { transform: none; }
  .teacher-card:hover { transform: none; }
  .podium-site .podium-item:hover { transform: none; }
  .subject-card:active, .teacher-card:active { opacity: 0.9; }
}
