/* ====================================================================
 *  مدرسة الزعفران الرسمية للغات - الموقع الرسمي
 *  ملف التنسيق الرئيسي (style.css)
 *  البرمجة: أحمد الشحات - 2026
 * ==================================================================== */

:root {
  --navy: #0b1e36;
  --navy-light: #1e467a;
  --gold: #d4af37;
  --gold-dark: #bd9a2b;
  --gold-light: #f5e6a8;
  --bg: #f6f9fc;
  --bg-soft: #eef3f8;
  --white: #ffffff;
  --text: #1a2233;
  --text-soft: #5b6573;
  --line: #e3e9f0;
  --green: #16a34a;
  --red: #dc2626;
  --shadow: 0 10px 30px rgba(11, 30, 54, 0.08);
  --shadow-lg: 0 20px 50px rgba(11, 30, 54, 0.15);
  --radius: 14px;
  --radius-lg: 22px;
  --max: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  direction: rtl;
  overflow-x: hidden;
}

a { color: var(--navy-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-dark); }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ====================  شريط أعلى (Top Bar) ==================== */
.topbar {
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(212, 175, 55, .3);
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar .info { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.topbar .info span { display: inline-flex; align-items: center; gap: 6px; }
.topbar .social { display: flex; gap: 10px; }
.topbar .social a {
  width: 26px; height: 26px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .12);
  color: #fff; border-radius: 50%; font-size: 13px;
}
.topbar .social a:hover { background: var(--gold); color: var(--navy); }

/* ====================  الهيدر + النف بار ==================== */
.site-header {
  background: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img {
  height: 55px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.08));
}
.brand .brand-text { line-height: 1.3; }
.brand .brand-text .name {
  font-size: 17px;
  font-weight: 900;
  color: var(--navy);
}
.brand .brand-text .sub {
  font-size: 12px;
  color: var(--gold-dark);
  font-weight: 700;
  letter-spacing: .5px;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  border-radius: 8px;
  transition: all .2s;
  white-space: nowrap;
}
.nav a:hover,
.nav a.active {
  background: var(--navy);
  color: #fff;
}
.nav a.cta-results {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--navy);
  margin-right: 4px;
}
.nav a.cta-results:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(212,175,55,.4); }
.nav a.cta-register {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
}
.nav a.cta-register:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(11,30,54,.3); }

/* زر القائمة للموبايل */
.menu-toggle {
  display: none;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 18px;
  cursor: pointer;
  font-family: 'Cairo';
}

@media (max-width: 980px) {
  .menu-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    display: none;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; border-radius: 8px; }
  .nav a:hover { background: var(--bg-soft); }
}

/* ====================  Hero / Slideshow ==================== */
.hero {
  position: relative;
  background: var(--navy);
  color: #fff;
  min-height: 460px;
  overflow: hidden;
}
.hero .slides {
  position: absolute;
  inset: 0;
}
.hero .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.hero .slide.active { opacity: 1; }
.hero .slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11,30,54,.85) 0%, rgba(11,30,54,.55) 60%, rgba(11,30,54,.75) 100%);
}
.hero .hero-content {
  position: relative;
  z-index: 2;
  padding: 80px 20px;
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
}
.hero h1 {
  font-size: 38px;
  font-weight: 900;
  margin-bottom: 16px;
  text-shadow: 0 4px 18px rgba(0,0,0,.35);
  line-height: 1.3;
}
.hero h1 .accent { color: var(--gold); }
.hero p {
  font-size: 18px;
  max-width: 760px;
  margin: 0 auto 28px;
  color: rgba(255,255,255,.92);
  line-height: 1.8;
}
.hero .hero-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 15px;
  font-family: 'Cairo';
  cursor: pointer;
  border: none;
  transition: all .25s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--navy);
  border: 1px solid var(--gold);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(212,175,55,.45); color: var(--navy); }
.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
}
.btn-secondary:hover { background: #fff; color: var(--navy); }
.btn-navy {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  border: 1px solid var(--gold);
}
.btn-navy:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(11,30,54,.3); color: #fff; }

/* نقاط الـ slideshow */
.hero .dots {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}
.hero .dots button {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: transparent;
  cursor: pointer;
  transition: all .2s;
}
.hero .dots button.active { background: var(--gold); border-color: var(--gold); width: 28px; border-radius: 6px; }

/* أسهم الـ slideshow */
.hero .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  font-size: 20px;
  transition: all .2s;
}
.hero .arrow:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.hero .arrow.prev { right: 18px; }
.hero .arrow.next { left: 18px; }

/* ====================  Quick Links Cards ==================== */
.quick-links {
  padding: 50px 0;
}
.quick-links .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.quick-link-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: all .25s;
  display: block;
}
.quick-link-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}
.quick-link-card .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--gold);
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
}
.quick-link-card h3 {
  color: var(--navy);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}
.quick-link-card p {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

/* ====================  Page Header (داخلي) ==================== */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  padding: 50px 20px 40px;
  position: relative;
}
.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 30%, rgba(212,175,55,.18), transparent 50%);
}
.page-header .container { position: relative; z-index: 2; }
.page-header h1 {
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 8px;
}
.page-header .breadcrumb {
  font-size: 13px;
  color: rgba(255,255,255,.85);
  font-weight: 700;
}
.page-header .breadcrumb a { color: var(--gold-light); }
.page-header .breadcrumb a:hover { color: var(--gold); }

/* ====================  Page Section ==================== */
.page-section {
  padding: 50px 0;
}
.page-section .lead {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 800px;
  margin-bottom: 30px;
  line-height: 1.9;
}
.section-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 18px;
  position: relative;
  padding-right: 18px;
}
.section-title::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 28px;
  background: var(--gold);
  border-radius: 6px;
}
.section-title.center { text-align: center; padding-right: 0; }
.section-title.center::before { display: none; }

/* كروت معلومات */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 30px;
}
.info-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  border-right: 4px solid var(--gold);
  transition: all .25s;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.info-card .ico {
  font-size: 30px;
  color: var(--navy-light);
  margin-bottom: 12px;
}
.info-card h4 {
  color: var(--navy);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
}
.info-card p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
}

/* ====================  News / Gallery / Activities grids ==================== */
.news-grid,
.gallery-grid,
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 30px;
}
.news-card,
.activity-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: all .25s;
}
.news-card:hover,
.activity-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.news-card .thumb,
.activity-card .thumb {
  height: 180px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  position: relative;
  overflow: hidden;
}
.news-card .thumb img,
.activity-card .thumb img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .5s;
}
.news-card:hover .thumb img,
.activity-card:hover .thumb img { transform: scale(1.06); }
.news-card .date-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
}
.news-card .body,
.activity-card .body { padding: 18px; }
.news-card .body h3,
.activity-card .body h3 {
  color: var(--navy);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.5;
}
.news-card .body p,
.activity-card .body p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.news-card .read-more,
.activity-card .read-more {
  color: var(--gold-dark);
  font-weight: 800;
  font-size: 13px;
}

.gallery-grid .photo {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.gallery-grid .photo img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .5s;
}
.gallery-grid .photo:hover img { transform: scale(1.08); }
.gallery-grid .photo .caption {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(transparent, rgba(11,30,54,.85));
  color: #fff;
  padding: 18px 14px 12px;
  font-size: 14px;
  font-weight: 700;
  transform: translateY(100%);
  transition: transform .3s;
}
.gallery-grid .photo:hover .caption { transform: translateY(0); }

/* ====================  Forms ==================== */
.form-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  max-width: 720px;
  margin: 0 auto;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 6px;
}
.form-group label .req { color: var(--red); }
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-family: 'Cairo';
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: #fbfcfe;
  transition: all .2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(212,175,55,.15);
}
textarea.form-control { resize: vertical; min-height: 120px; }
.form-actions { margin-top: 20px; text-align: center; }
.form-note {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 10px;
  text-align: center;
}
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-weight: 700;
  display: none;
}
.alert.show { display: block; animation: slideIn .3s ease-out; }
.alert-success { background: #dcfce7; color: #166534; border-right: 4px solid var(--green); }
.alert-error { background: #fee2e2; color: #991b1b; border-right: 4px solid var(--red); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ====================  Results Page ==================== */
.results-card {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 38px 32px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--gold);
  text-align: center;
}
.results-card .logos { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.results-card .logos img { height: 70px; }
.results-card h1 {
  color: var(--navy);
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 6px;
}
.results-card h2 {
  color: var(--gold-dark);
  font-size: 15px;
  margin-bottom: 26px;
  font-weight: 700;
}

/* ====================  Stats ==================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 22px;
  margin: 30px 0;
}
.stat-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  border-bottom: 4px solid var(--gold);
}
.stat-box .num {
  font-size: 38px;
  font-weight: 900;
  color: var(--navy);
  line-height: 1;
}
.stat-box .label {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 700;
  margin-top: 6px;
}

/* ====================  Footer ==================== */
.site-footer {
  background: var(--navy);
  color: #fff;
  padding: 50px 0 0;
  margin-top: 60px;
}
.site-footer .grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
@media (max-width: 800px) {
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .site-footer .grid { grid-template-columns: 1fr; }
}
.site-footer h4 {
  color: var(--gold);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
}
.site-footer .about-footer img { height: 50px; margin-bottom: 14px; }
.site-footer .about-footer p {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  line-height: 1.8;
}
.site-footer ul { list-style: none; }
.site-footer ul li {
  margin-bottom: 8px;
  font-size: 13px;
}
.site-footer ul li a {
  color: rgba(255,255,255,.78);
  transition: all .2s;
}
.site-footer ul li a:hover { color: var(--gold); padding-right: 5px; }
.site-footer .contact-info li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: rgba(255,255,255,.78);
}
.site-footer .copyright {
  text-align: center;
  padding: 18px 0;
  font-size: 13px;
  color: rgba(255,255,255,.7);
}
.site-footer .copyright a { color: var(--gold); }

/* ====================  Misc ==================== */
.text-center { text-align: center; }
.mt-30 { margin-top: 30px; }
.mt-50 { margin-top: 50px; }
.mb-30 { margin-bottom: 30px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-soft);
}
.empty-state .ico {
  font-size: 50px;
  color: var(--gold);
  margin-bottom: 14px;
}

/* certificate area host (لصفحة النتيجة على pages.dev) */
#certificate-host iframe {
  width: 100%;
  min-height: 800px;
  border: 0;
}

.loading-spinner {
  display: none;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
  color: var(--navy);
  font-weight: 700;
}
.loading-spinner.show { display: flex; }
.spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* timeline - لصفحة الأخبار/الأحداث */
.timeline { position: relative; padding-right: 30px; margin-top: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  right: 8px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(var(--gold), var(--navy-light));
}
.timeline .item {
  position: relative;
  margin-bottom: 28px;
  padding: 18px 22px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.timeline .item::before {
  content: "";
  position: absolute;
  right: -30px;
  top: 22px;
  width: 18px;
  height: 18px;
  background: var(--gold);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold);
}
.timeline .item .date {
  font-size: 13px;
  color: var(--gold-dark);
  font-weight: 800;
  margin-bottom: 6px;
}
.timeline .item h4 {
  color: var(--navy);
  font-size: 17px;
  margin-bottom: 6px;
  font-weight: 800;
}
.timeline .item p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
}
