:root {
  --afnan-green: #087855;
  --afnan-green-dark: #075e46;
  --afnan-navy: #102d40;
  --afnan-gold: #d1a62a;
  --afnan-cream: #fbfaf5;
  --afnan-muted: #78838c;
  --afnan-border: #e1e7e4;
}

.afnan-teachers-section,
.afnan-teacher-profile {
  direction: rtl;
  color: var(--afnan-navy);
  font-family: inherit;
}

.afnan-teachers-section {
  padding: clamp(64px, 7vw, 104px) 24px;
  background: var(--afnan-cream);
  border-top: 1px solid rgba(8, 120, 85, .08);
  border-bottom: 1px solid rgba(8, 120, 85, .08);
}

.afnan-teachers-shell,
.afnan-profile-shell {
  width: min(100%, 1320px);
  margin-inline: auto;
}

.afnan-teachers-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 38px;
}

.afnan-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--afnan-green);
  font-size: .92rem;
  font-weight: 800;
}

.afnan-eyebrow::before {
  content: '';
  width: 30px;
  height: 2px;
  border-radius: 2px;
  background: var(--afnan-gold);
}

.afnan-teachers-heading h2 {
  margin: 0;
  color: var(--afnan-navy);
  font-size: clamp(2rem, 3.2vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.afnan-teachers-heading p {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--afnan-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.afnan-all-teachers {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  color: var(--afnan-green);
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.afnan-all-teachers:hover { color: var(--afnan-green-dark); }
.afnan-all-teachers span { transition: transform .2s ease; }
.afnan-all-teachers:hover span { transform: translateX(-4px); }

.afnan-teachers-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.afnan-teacher-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  padding: 28px;
  border: 1px solid var(--afnan-border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(16, 45, 64, .06);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.afnan-teacher-card:hover {
  transform: translateY(-6px);
  border-color: rgba(8, 120, 85, .26);
  box-shadow: 0 18px 42px rgba(16, 45, 64, .12);
}

.afnan-teacher-avatar {
  position: relative;
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  align-self: center;
  margin-bottom: 18px;
  border: 2px solid rgba(8, 120, 85, .18);
  border-radius: 50%;
  background: #edf7f3;
  color: var(--afnan-green);
  font-size: 1.75rem;
  font-weight: 900;
  text-decoration: none;
}

.afnan-teacher-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.afnan-verified {
  position: absolute;
  right: -1px;
  bottom: 3px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--afnan-green);
  color: var(--afnan-gold);
  font-size: .72rem;
  font-style: normal;
  font-weight: 900;
}

.afnan-teacher-copy { text-align: center; }
.afnan-teacher-copy h3 { margin: 0 0 8px; font-size: 1.18rem; line-height: 1.45; }
.afnan-teacher-copy h3 a { color: var(--afnan-navy); text-decoration: none; }
.afnan-role { min-height: 3em; margin: 0; color: var(--afnan-muted); font-size: .93rem; line-height: 1.6; }

.afnan-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 13px;
  font-size: .85rem;
}

.afnan-rating span { color: var(--afnan-gold); letter-spacing: 1px; }
.afnan-rating small { color: var(--afnan-muted); }

.afnan-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 15px;
  color: var(--afnan-muted);
  font-size: .8rem;
}

.afnan-specialties {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 17px;
}

.afnan-specialties span {
  padding: 6px 12px;
  border: 1px solid #e5e8e4;
  border-radius: 999px;
  background: #faf9f5;
  color: #66727b;
  font-size: .76rem;
  line-height: 1.2;
}

.afnan-audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 12px;
  border: 1px solid #e8e7df;
  border-radius: 16px;
  background: #fbfaf6;
}

.afnan-teacher-copy + .afnan-audio-player { margin-top: 22px; }

.afnan-audio-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--afnan-green);
  color: #fff;
  cursor: pointer;
  font-size: .95rem;
}

.afnan-audio-toggle:hover,
.afnan-audio-toggle:focus-visible { background: var(--afnan-green-dark); }
.afnan-audio-toggle:focus-visible { outline: 3px solid rgba(209, 166, 42, .42); outline-offset: 3px; }

.afnan-audio-info { min-width: 0; flex: 1; }
.afnan-audio-info strong { display: block; overflow: hidden; color: var(--afnan-navy); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }

.afnan-audio-track {
  position: relative;
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5ece8;
  cursor: pointer;
}

.afnan-audio-track i {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--afnan-green);
}

.afnan-audio-player time { flex: none; color: #8a949b; font-size: .66rem; direction: ltr; }

.afnan-teacher-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 20px;
  border: 2px solid var(--afnan-green);
  border-radius: 14px;
  color: var(--afnan-green);
  font-size: .92rem;
  font-weight: 850;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}

.afnan-teacher-link:hover { background: var(--afnan-green); color: #fff; }

.afnan-teachers-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 150px;
  padding: 28px;
  border: 1px dashed rgba(8, 120, 85, .35);
  border-radius: 20px;
  background: #fff;
  text-align: center;
}

.afnan-teachers-empty span { color: var(--afnan-muted); }
.afnan-teachers-empty a { color: var(--afnan-green); font-weight: 800; }

.afnan-teacher-profile { padding: clamp(60px, 8vw, 112px) 24px; background: var(--afnan-cream); }
.afnan-profile-back { display: inline-flex; margin-bottom: 26px; color: var(--afnan-green); font-weight: 800; text-decoration: none; }

.afnan-profile-card {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  overflow: hidden;
  border: 1px solid var(--afnan-border);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 56px rgba(16, 45, 64, .09);
}

.afnan-profile-media { min-height: 430px; background: #edf7f3; }
.afnan-profile-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.afnan-profile-placeholder { display: grid; height: 100%; min-height: 430px; place-items: center; color: var(--afnan-green); font-size: 2rem; font-weight: 900; }
.afnan-profile-content { display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 6vw, 82px); }
.afnan-profile-content h1 { margin: 0 0 10px; color: var(--afnan-navy); font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.15; }
.afnan-profile-role { margin: 0; color: var(--afnan-muted); font-size: 1.1rem; }
.afnan-profile-content .afnan-specialties { justify-content: flex-start; }
.afnan-profile-languages { margin: 22px 0 0; color: var(--afnan-muted); }
.afnan-profile-languages strong { color: var(--afnan-navy); }

.afnan-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.afnan-profile-stats span { min-width: 110px; padding: 14px 16px; border-radius: 14px; background: #f6f9f7; color: var(--afnan-muted); }
.afnan-profile-stats strong { display: block; margin-bottom: 2px; color: var(--afnan-green); font-size: 1.25rem; }
.afnan-audio-player--profile { max-width: 560px; margin-top: 28px; }

.afnan-profile-bio {
  margin-top: 28px;
  padding: clamp(28px, 4vw, 50px);
  border: 1px solid var(--afnan-border);
  border-radius: 24px;
  background: #fff;
  color: #4e5f6a;
  font-size: 1.05rem;
  line-height: 1.95;
}

.afnan-profile-bio h2 { margin-top: 0; color: var(--afnan-navy); font-size: 1.8rem; }

.afnan-profile-panel {
  overflow: hidden;
  border: 1px solid var(--afnan-border);
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 45, 64, .1);
}

.afnan-profile-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--afnan-border);
}

.afnan-profile-panel-head h1 { margin: 0; color: var(--afnan-navy); font-size: 1.5rem; }
.afnan-profile-panel-head a { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: #f4f7f5; color: #66727b; font-size: 1.8rem; line-height: 1; text-decoration: none; }

.afnan-profile-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 36px 46px 18px;
}

.afnan-profile-avatar {
  position: relative;
  display: grid;
  width: 118px;
  height: 118px;
  flex: none;
  place-items: center;
  border: 3px solid rgba(8, 120, 85, .18);
  border-radius: 50%;
  background: #edf7f3;
  color: var(--afnan-green);
  font-size: 2rem;
  font-weight: 900;
}

.afnan-profile-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.afnan-profile-avatar i { position: absolute; right: 2px; bottom: 4px; display: grid; width: 31px; height: 31px; place-items: center; border: 3px solid #fff; border-radius: 50%; background: var(--afnan-green); color: var(--afnan-gold); font-size: .75rem; font-style: normal; }
.afnan-profile-identity { min-width: 0; flex: 1; }
.afnan-profile-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.afnan-profile-name-row h2 { margin: 0; color: var(--afnan-navy); font-size: clamp(1.8rem, 3vw, 2.55rem); }
.afnan-profile-name-row span { padding: 6px 11px; border-radius: 999px; background: #edf8f4; color: var(--afnan-green); font-size: .75rem; font-weight: 800; }
.afnan-profile-identity > p { margin: 7px 0 14px; color: var(--afnan-muted); font-size: 1.05rem; }
.afnan-profile-contact { display: flex; flex-wrap: wrap; gap: 18px; }
.afnan-profile-contact a { color: #536673; text-decoration: none; }

.afnan-profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 46px 30px;
}

.afnan-profile-metrics > div { display: grid; min-height: 128px; place-items: center; padding: 16px; border: 1px solid var(--afnan-border); border-radius: 18px; background: var(--afnan-cream); text-align: center; }
.afnan-profile-metrics span { color: var(--afnan-green); font-size: 1.45rem; }
.afnan-profile-metrics strong { color: var(--afnan-navy); font-size: 1.25rem; }
.afnan-profile-metrics small { color: var(--afnan-muted); }

.afnan-profile-details { padding: 2px 46px 34px; }
.afnan-profile-details section { margin-top: 24px; }
.afnan-profile-details h3 { margin: 0 0 12px; color: var(--afnan-navy); font-size: 1.06rem; }
.afnan-profile-details section > p { margin: 0; color: #536673; line-height: 1.95; }
.afnan-profile-meta { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 24px; color: #536673; }
.afnan-profile-specialties { justify-content: flex-start; margin-top: 0; }

.afnan-profile-panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 46px; border-top: 1px solid var(--afnan-border); background: #fcfdfc; }
.afnan-profile-panel-actions span { color: var(--afnan-muted); font-size: .82rem; }
.afnan-profile-book { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 14px; background: var(--afnan-green); color: #fff; font-weight: 850; text-decoration: none; }
.afnan-profile-book:hover { background: var(--afnan-green-dark); color: #fff; }

@media (max-width: 1100px) {
  .afnan-teachers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .afnan-teachers-section { padding-inline: 18px; }
  .afnan-teachers-heading { align-items: flex-start; flex-direction: column; margin-bottom: 28px; }
  .afnan-teachers-grid { grid-template-columns: 1fr; }
  .afnan-teacher-card { padding: 24px; }
  .afnan-teachers-empty { align-items: stretch; flex-direction: column; }
  .afnan-profile-card { grid-template-columns: 1fr; }
  .afnan-profile-media, .afnan-profile-placeholder { min-height: 330px; }
  .afnan-profile-content { padding: 32px 24px; }
  .afnan-profile-panel-head { padding: 18px 20px; }
  .afnan-profile-summary { align-items: flex-start; padding: 28px 22px 16px; }
  .afnan-profile-avatar { width: 84px; height: 84px; font-size: 1.35rem; }
  .afnan-profile-name-row h2 { font-size: 1.5rem; }
  .afnan-profile-contact { gap: 8px; font-size: .8rem; }
  .afnan-profile-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px 22px 24px; }
  .afnan-profile-details { padding: 0 22px 26px; }
  .afnan-profile-panel-actions { align-items: stretch; flex-direction: column; padding: 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .afnan-teacher-card,
  .afnan-all-teachers span,
  .afnan-teacher-link { transition: none; }
}
