*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gold: #c9a84c;
  --gold-light: #f5ecd4;
  --gold-hover: #b8923e;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 11rem;
}
body {
  font-family: "Cairo", sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  direction: rtl;
}
.logo-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
}

/* ===== HEADER ===== */
.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-icon {
  width: 42px;
  height: 42px;
  background: var(--gold-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.header-title {
  font-size: 19px;
  font-weight: 700;
}
.header-sub {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 1px;
}
.back-link {
  margin-right: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}
.back-link:hover {
  color: var(--gold-hover);
}

/* ===== MAIN ===== */
main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 48px 24px 100px;
}

/* ===== HERO ===== */
/* Hero Section Styling */
/* ══ HERO ══ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 120px 28px 80px;

  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 50%, #eef2ff 100%);
}
.hero-content {
  max-width: 820px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-radius: 100px;
  background: var(--gold-dim);
  border: 1px solid rgba(201, 168, 76, 0.25);
  color: var(--gold-light);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 0.7s 0.1s forwards;
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.hero-title {
  font-family: "Cairo", sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 28px;
}
.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 0.7s forwards;
}
.hero-title .line:nth-child(1) {
  animation-delay: 0.2s;
}
.hero-title .line:nth-child(2) {
  animation-delay: 0.35s;
  color: var(--gold);
}
.hero-title .line:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.8;
  max-width: 560px;
  margin: 0 auto 44px;
  opacity: 0;
  animation: fadeUp 0.7s 0.65s forwards;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 0.7s 0.8s forwards;
  margin-bottom: 72px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold) 0%, #a07828 100%);
  color: #0a0a0f;
  font-weight: 800;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  font-family: "Tajawal", sans-serif;
  box-shadow: 0 8px 32px rgba(201, 168, 76, 0.3);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(201, 168, 76, 0.45);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid var(--border2);
  cursor: pointer;
  transition: all 0.3s;
  font-family: "Tajawal", sans-serif;
}
.btn-outline:hover {
  background: var(--surface2);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ── Hero stats row ── */
.hero-stats {
  display: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 0.7s 1s forwards;
  max-width: 680px;
  margin: 0 auto;
}
.hstat {
  background: var(--surface);
  padding: 24px 16px;
  text-align: center;
  transition: background 0.2s;
}
.hstat:hover {
  background: var(--surface2);
}
.hstat-num {
  font-family: "Cairo", sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}
.hstat-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.hero-content {
  max-width: 600px;
  text-align: right; /* النص يمين */
}

.hero-content h1 {
  font-size: 3rem;
  color: #ffd700; /* دهبي */
  margin-bottom: 20px;
  font-weight: 700;
}

.hero-content p {
  font-size: 1.2rem;
  line-height: 1.8;
  margin-bottom: 30px;
}

.cta-btn {
  background-color: #ffd700;
  color: #000;
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s ease;
}

.cta-btn:hover {
  background-color: #fff;
  color: #000;
}

#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 40px;

  background: url("../images/الطلاب\ المتميزون.png");
  background-size: cover;
  background-position: center;
}

/* طبقة فوق الصورة */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}

/* الكونتينر */
.hero-container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;

  align-items: center;
  gap: 40px;
}

/* النص */
.hero-text {
  color: white;
  text-align: right;
}

/* badge */
.hero-badge {
  display: inline-block;
  background: rgba(201, 168, 76, 0.2);
  color: var(--gold);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  margin-bottom: 20px;
}

/* العنوان */
.hero-title {
  font-size: 3rem;
  font-weight: 900;
  font-family: "Cairo", sans-serif;
  margin-bottom: 20px;

  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);

  background: linear-gradient(90deg, #c9a84c, #e8c96d);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* النص */
.hero-desc {
  color: #e5e7eb;
  line-height: 1.8;
  margin-bottom: 30px;
}

/* الأزرار */
.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
}

/* stats */
.hero-stats {
  display: flex;
  gap: 40px;
}

.hero-stats .num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold);
}

.hero-stats .label {
  display: block;
  font-size: 0.8rem;
  color: #d1d5db;
}

/* الصورة */
.hero-image img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* موبايل */
@media (max-width: 768px) {
  .hero-container {
    grid-template-columns: 1fr;
  }

  .hero-text {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }
}
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 24px 100px;
}

.hero-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--gold);
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.35);
  transition:
    background 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.btn-primary:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(201, 168, 76, 0.42);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--white);
  color: var(--gray-800);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  text-decoration: none;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}
/* ===== SECTION LABEL ===== */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.section-label::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 22px;
}

/* =============================================
   SECTION 1 — CERTIFICATES
   4 category cards → click → show students list
============================================= */
.certs-section {
  margin-bottom: 70px;
}

/* ---- search bar ---- */
.search-wrap {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  padding: 11px 20px;
  max-width: 420px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.search-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-light);
}
.search-wrap input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  background: none;
  color: var(--gray-800);
  flex: 1;
}
.search-wrap input::placeholder {
  color: var(--gray-400);
}

/* ---- 4 category cards ---- */
.cert-categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}

/* The card that matches the screenshot exactly */
.cat-card {
  background: var(--gold-light);
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
  text-align: center;
}
.cat-card:hover,
.cat-card.active {
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.25);
  transform: translateY(-3px);
}
.cat-card.active {
  box-shadow:
    0 0 0 3px var(--gold),
    0 8px 24px rgba(201, 168, 76, 0.2);
}

/* big emoji area — same gold-light bg as screenshot */
.cat-icon-area {
  background: linear-gradient(160deg, #f5ecd4 0%, #fffbef 100%);
  padding: 36px 20px 28px;
  font-size: 58px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-info {
  padding: 16px 16px 20px;
  background: var(--white);
  flex: 1;
}
.cat-name {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}
.cat-sub {
  font-size: 12px;
  color: var(--gold-hover);
  font-weight: 600;
  margin-bottom: 8px;
}
.cat-count {
  font-size: 11.5px;
  color: var(--gray-400);
}

/* ---- student list that appears under the selected category ---- */
.students-under-cert {
  display: none;
  animation: fadeUp 0.3s ease;
}
.students-under-cert.show {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cert-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 14px 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
}
.cert-list-title {
  font-size: 15px;
  font-weight: 700;
}
.cert-list-close {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
}
.cert-list-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.cert-students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* each student row inside the cert list */
.cert-student-row {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.cert-student-row:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.15);
}

.cert-student-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.cert-student-info {
  flex: 1;
}
.cert-student-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}
.cert-student-level {
  font-size: 11.5px;
  color: var(--gray-400);
}

.cert-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: var(--gold);
  color: var(--white);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.2s;
}
.cert-dl-btn:hover {
  background: var(--gold-hover);
}

/* no-results message */
.no-results {
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
  padding: 30px 0;
  display: none;
}
.no-results.show {
  display: block;
}

/* =============================================
   SECTION 2 — STAR STUDENTS
   Same card style as teachers page
============================================= */
.students-section {
  margin-bottom: 60px;
}

.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.22s,
    box-shadow 0.22s,
    border-color 0.22s;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
  border-color: var(--gold);
}

.card-photo {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.card-no-photo {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(150deg, var(--gold-light) 0%, #fffbef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
}

.card-body {
  padding: 20px 20px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.student-name {
  font-size: 17px;
  font-weight: 800;
}
.student-level {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold-hover);
  margin-top: -4px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  background: var(--gold-light);
  color: var(--gold-hover);
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 11px;
}

.student-bio {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.75;
}

.stats {
  display: flex;
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
  margin-top: auto;
}
.stat {
  flex: 1;
  text-align: center;
  border-left: 1px solid var(--gray-200);
  padding: 0 6px;
}
.stat:last-child {
  border-left: none;
}
.stat-val {
  font-size: 17px;
  font-weight: 800;
  color: var(--gold);
}
.stat-lbl {
  font-size: 10.5px;
  color: var(--gray-400);
  margin-top: 1px;
}

.cert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 18px 18px;
  padding: 13px 0;
  background: var(--gold);
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.28);
  transition:
    background 0.2s,
    transform 0.2s;
}
.cert-btn:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .cert-categories {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 680px) {
  main {
    padding: 28px 14px 70px;
  }
  .page-header {
    padding: 14px 16px;
  }
  .cert-categories {
    grid-template-columns: repeat(2, 1fr);
  }
  .students-grid {
    grid-template-columns: 1fr;
  }
}
.cert-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  display: block;
}

.cert-student-row {
  padding: 10px;
}
.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-image {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
}

.close-image {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.close-image:hover {
  color: #ddd;
}
