:root {
  --bg-dark: #23110B;
  --bg-brown: #3A1D12;
  --bg-card-header: #4E2415;
  --terracotta: #8C331A;
  --terracotta-hover: #A83E20;
  --amber-gold: #D48C46;
  --amber-light: #F3C68F;
  --cream-bg: #F7EFE6;
  --cream-card: #FFFDF9;
  --text-dark: #2A160D;
  --text-muted: #6E5246;
  --border-sand: #E5D3C0;
  --white: #FFFFFF;
  --shadow-lg: 0 14px 30px rgba(35, 17, 11, 0.14);
  --shadow-sm: 0 4px 12px rgba(35, 17, 11, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', sans-serif;
  background-color: var(--cream-bg);
  color: var(--text-dark);
  line-height: 1.7;
}

.container {
  width: 92%;
  max-width: 1260px;
  margin: 0 auto;
}

/* شريط التنقل */
.navbar {
  background-color: rgba(35, 17, 11, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 140, 70, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.9rem 0;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  height: 48px;
  width: auto;
  border-radius: 8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-ar {
  color: var(--white);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.2;
}

.brand-en {
  color: var(--amber-gold);
  font-size: 0.75rem;
  letter-spacing: 1.2px;
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--cream-bg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--amber-gold);
}

/* الأزرار العامة */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.65rem 1.4rem;
  border-radius: 50px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.btn-lg {
  padding: 0.85rem 1.9rem;
  font-size: 1.05rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--terracotta), #6E230E);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(140, 51, 26, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--terracotta-hover), var(--terracotta));
  transform: translateY(-2px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.08);
  color: var(--amber-light);
  border: 1.5px solid var(--amber-gold);
}

.btn-outline:hover {
  background: var(--amber-gold);
  color: var(--bg-dark);
}

.btn-light {
  background: var(--cream-bg);
  color: var(--bg-brown);
}

.btn-light:hover {
  background: var(--amber-light);
}

/* القسم الترحيبي (Hero) */
.hero {
  position: relative;
  background: radial-gradient(circle at top left, #6A2E1B 0%, var(--bg-brown) 45%, var(--bg-dark) 100%);
  color: var(--white);
  padding: 4.5rem 0;
  overflow: hidden;
  border-bottom: 4px solid var(--amber-gold);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.slogan-badge {
  display: inline-block;
  background: rgba(212, 140, 70, 0.18);
  border-right: 3px solid var(--amber-gold);
  color: var(--amber-light);
  padding: 0.35rem 1rem;
  border-radius: 6px;
  font-weight: 700;
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 1.2rem;
}

.hero-title .highlight {
  color: var(--amber-gold);
}

.hero-desc {
  color: #E6D5C7;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 620px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 2.2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--amber-gold);
}

.stat-label {
  font-size: 0.85rem;
  color: #D9C3B0;
}

.arch-frame {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 10px;
  background: linear-gradient(145deg, var(--amber-gold), rgba(212, 140, 70, 0.2));
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.hero-img {
  width: 100%;
  height: 390px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.floating-card {
  position: absolute;
  bottom: -16px;
  right: 20px;
  left: 20px;
  background: var(--bg-brown);
  border: 1px solid var(--amber-gold);
  color: var(--cream-bg);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
}

/* قسم الكورسات والورشات */
.programs-section {
  padding: 4.5rem 0;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3rem;
}

.section-subtitle {
  color: var(--terracotta);
  font-weight: 800;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 0.3rem;
}

.section-title {
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--bg-brown);
  margin-bottom: 0.7rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 1.8rem;
}

.filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: #EFE2D3;
  padding: 0.45rem;
  border-radius: 50px;
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 0.55rem 1.35rem;
  border-radius: 50px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--bg-brown);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active {
  background: var(--bg-brown);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

/* شبكة الكروت */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem;
}

.course-card {
  background: var(--cream-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-sand);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--amber-gold);
}

/* رأس الكرت المستوحى من البوسترات */
.card-banner {
  background: linear-gradient(145deg, #5A2816 0%, #2E140B 100%);
  color: var(--white);
  padding: 1.5rem 1.4rem 1.2rem;
  position: relative;
  border-bottom: 3px solid var(--amber-gold);
}

.badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.course-badge {
  background: var(--cream-bg);
  color: var(--bg-brown);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.25rem 0.85rem;
  border-radius: 50px;
}

.course-code {
  color: var(--amber-light);
  font-size: 0.78rem;
  font-weight: 700;
}

.card-title-ar {
  font-size: 1.32rem;
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  color: var(--white);
}

.card-title-en {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--amber-light);
  direction: ltr;
  text-align: right;
}

/* جسم الكرت */
.card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-summary {
  color: var(--text-dark);
  font-size: 0.94rem;
  margin-bottom: 1.1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* المميزات الأربعة من البوسترات */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  margin-bottom: 1.2rem;
}

.highlight-pill {
  background: #F4E8DA;
  border: 1px solid #E3D0BA;
  color: var(--bg-brown);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.highlight-pill::before {
  content: "◈";
  color: var(--terracotta);
}

/* شريط معلومات الكورس (المدة، المستوى، الفئة) */
.meta-box {
  background: var(--bg-brown);
  color: var(--cream-bg);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: auto;
  margin-bottom: 1.2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  font-size: 0.82rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-item.full-width {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.5rem;
}

.meta-label {
  color: var(--amber-light);
  font-weight: 700;
  font-size: 0.74rem;
}

.meta-val {
  color: var(--white);
  font-weight: 600;
}

/* أزرار الكرت السفلية */
.card-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.65rem;
}

.btn-register-wa {
  background: var(--terracotta);
  color: var(--white);
  padding: 0.7rem 1rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s, transform 0.2s;
}

.btn-register-wa:hover {
  background: var(--terracotta-hover);
  transform: translateY(-2px);
}

.btn-details {
  background: transparent;
  border: 1.5px solid var(--bg-brown);
  color: var(--bg-brown);
  padding: 0.65rem 0.9rem;
  border-radius: 50px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-details:hover {
  background: var(--bg-brown);
  color: var(--white);
}

/* قسم المميزات */
.features-section {
  padding: 2rem 0 4.5rem;
}

.features-banner {
  background: linear-gradient(135deg, var(--bg-brown) 0%, #582614 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border: 2px solid var(--amber-gold);
  box-shadow: var(--shadow-lg);
}

.features-text h2 {
  font-size: 1.75rem;
  margin-bottom: 0.6rem;
  color: var(--amber-light);
}

.features-text p {
  color: #E8D7C8;
  margin-bottom: 1rem;
}

.features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
}

/* النافذة المنبثقة للتفاصيل الكاملة (Modal) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 11, 6, 0.78);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  z-index: 200;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background: var(--cream-card);
  color: var(--text-dark);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  border: 2px solid var(--amber-gold);
  padding: 2rem;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg-brown);
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-section-title {
  color: var(--terracotta);
  font-weight: 800;
  font-size: 1.05rem;
  margin: 1.2rem 0 0.5rem;
  border-right: 3px solid var(--amber-gold);
  padding-right: 0.6rem;
}

.modal-list {
  padding-right: 1.3rem;
  margin-bottom: 1rem;
}

.modal-list li {
  margin-bottom: 0.35rem;
}

/* التذييل */
.footer {
  background: var(--bg-dark);
  color: var(--cream-bg);
  padding: 3rem 0 1.5rem;
  border-top: 3px solid var(--amber-gold);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand h3 {
  color: var(--amber-gold);
  margin-bottom: 0.3rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.2rem;
  font-size: 0.85rem;
  color: #B9A190;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
  .features-banner {
    flex-direction: column;
    text-align: center;
  }
}