/* ============================================================
   أكاديمية مِداد التعليمية - التصميم العام
   Medad Educational Academy - Stylesheet
   Direction: RTL (Right-to-Left)
   ============================================================ */

/* متغيرات الألوان والخطوط */
:root {
  --primary-color: #1e3a8a;      /* أزرق عميق */
  --primary-dark: #1e40af;
  --secondary-color: #0f766e;    /* أزرق زيتوني/أخضر */
  --accent-color: #25d366;       /* أخضر واتساب */
  --light-bg: #f8fafc;
  --white: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
            0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
               0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
}

/* إعادة تعيين أساسية */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  direction: rtl;
  lang: ar;
}

body {
  font-family: "Tajawal", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul, ol {
  list-style: none;
}

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

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

/* الخط العربي المخصص */
@font-face {
  font-family: "Tajawal";
  font-style: normal;
  font-weight: 400;
  src: local("Tajawal"), local("Tajawal-Regular"),
       url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap");
}

/* استيراد خط تاواجل من Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap");

/* =====================
   عناصر التنقل (Navbar)
   ===================== */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  flex-wrap: wrap;
  gap: 15px;
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.navbar .logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.navbar .logo span {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-color);
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
}

.btn-whatsapp:hover {
  background: #1ebe59;
  color: var(--white);
  transform: translateY(-2px);
}

.btn-whatsapp svg {
  width: 18px;
  height: 18px;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
}

/* =====================
   الصفحة الرئيسية - Hero
   ===================== */
.hero {
  position: relative;
  height: 75vh;
  min-height: 550px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  z-index: 1;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  padding: 0 20px;
  max-width: 850px;
  margin: 0 auto;
}

.hero-content h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.3;
}

.hero-content p {
  font-size: clamp(16px, 2.5vw, 20px);
  margin-bottom: 34px;
  opacity: 0.95;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary,
.btn-outline {
  padding: 14px 30px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 16px;
  display: inline-block;
  transition: var(--transition);
}

.btn-primary {
  background: var(--white);
  color: var(--primary-color);
}

.btn-primary:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

/* =====================
   قسم النبذة (About)
   ===================== */
.about {
  padding: 90px 0;
  background: var(--white);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 30px;
  color: var(--primary-color);
  margin-bottom: 18px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-image {
  position: relative;
}

.about-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: block;
}

.about-text h3 {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 22px;
}

.about-text p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 22px;
  line-height: 1.8;
}

.about-text .features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-text .features-list li {
  padding: 12px 0;
  font-size: 16px;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
}

.about-text .features-list li:last-child {
  border-bottom: none;
}

.about-text .features-list li:before {
  content: "✓";
  color: var(--secondary-color);
  font-weight: bold;
  margin-left: 14px;
  flex-shrink: 0;
  font-size: 18px;
}

/* =====================
   بطاقات الخدمات
   ===================== */
.services {
  padding: 90px 0;
  background: var(--light-bg);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.service-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 30px;
  flex-shrink: 0;
}

.service-card h3 {
  font-size: 20px;
  color: var(--primary-color);
  margin-bottom: 14px;
}

.service-card p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
}

/* =====================
   قسم الإحصائيات
   ===================== */
.stats {
  padding: 70px 0;
  background: var(--primary-color);
  color: var(--white);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 35px;
  text-align: center;
}

.stat-item h4 {
  font-size: 34px;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 10px;
}

.stat-item p {
  font-size: 16px;
  opacity: 0.9;
}

/* =====================
   تذييل الموقع (Footer)
   ===================== */
footer {
  background: var(--text-dark);
  color: var(--white);
  padding: 70px 0 35px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 45px;
  margin-bottom: 45px;
}

.footer-brand .logo-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.footer-brand .logo-footer img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.footer-brand .logo-footer span {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  white-space: nowrap;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.8;
  max-width: 280px;
}

.footer-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 22px;
  color: var(--white);
}

.footer-links li {
  margin-bottom: 14px;
}

.footer-links a {
  color: #94a3b8;
  font-size: 15px;
}

.footer-links a:hover {
  color: var(--accent-color);
  padding-left: 5px;
}

.contact-info li {
  margin-bottom: 16px;
  font-size: 15px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-info svg {
  color: var(--accent-color);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.contact-info div a {
  color: var(--primary-color);
  font-weight: 500;
}

.contact-info div a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 30px;
  text-align: center;
  font-size: 14px;
  color: #94a3b8;
}

/* =====================
   صفحة الخدمات - تنسيق خاص
   ===================== */
.services-page-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--white);
  padding: 110px 0;
  text-align: center;
}

.services-page-header h1 {
  font-size: clamp(28px, 5vw, 40px);
  margin-bottom: 18px;
  line-height: 1.4;
}

.services-page-header p {
  font-size: clamp(16px, 2vw, 18px);
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.detail-services {
  padding: 90px 0;
}

.service-detail-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 35px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  border-left: 4px solid var(--secondary-color);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.service-detail-card:hover {
  transform: translateX(-8px);
  box-shadow: var(--shadow-lg);
}

.service-detail-card h3 {
  font-size: 22px;
  color: var(--primary-color);
  margin-bottom: 14px;
}

.service-detail-card p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.8;
  margin: 0;
}

.service-detail-card .badge {
  display: inline-block;
  background: var(--light-bg);
  color: var(--primary-color);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* =====================
   صفحة التواصل - تنسيق خاص
   ===================== */
.contact-page-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--white);
  padding: 100px 0;
  text-align: center;
}

.contact-page-header h1 {
  font-size: clamp(28px, 5vw, 40px);
  margin-bottom: 18px;
  line-height: 1.4;
}

.contact-page-header p {
  font-size: clamp(16px, 2vw, 18px);
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.contact-section {
  padding: 90px 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 45px;
}

.contact-info-card {
  background: var(--white);
  padding: 35px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.contact-info-card h3 {
  font-size: 22px;
  color: var(--primary-color);
  margin-bottom: 28px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.info-item svg {
  width: 20px;
  height: 20px;
  color: var(--secondary-color);
  flex-shrink: 0;
}

.info-item div {
  font-size: 16px;
  color: var(--text-dark);
}

.info-item div a {
  color: var(--primary-color);
  font-weight: 500;
}

.info-item div a:hover {
  color: var(--secondary-color);
}

.social-links {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 14px;
}

.social-links a {
  width: 42px;
  height: 42px;
  background: var(--light-bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 18px;
}

.social-links a:hover {
  background: var(--accent-color);
  color: var(--white);
}

.contact-form-card {
  background: var(--white);
  padding: 35px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.contact-form-card h3 {
  font-size: 22px;
  color: var(--primary-color);
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 15px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  color: var(--text-dark);
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.btn-submit {
  width: 100%;
  background: var(--primary-color);
  color: var(--white);
  padding: 16px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-submit:hover {
  background: var(--primary-dark);
}

.btn-whatsapp-block {
  width: 100%;
  background: var(--accent-color);
  color: var(--white);
  padding: 16px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-whatsapp-block svg {
  width: 20px;
  height: 20px;
}

.btn-whatsapp-block:hover {
  background: #1ebe59;
}

/* =====================
   تصميم متجاوب (Responsive)
   ===================== */
@media (max-width: 992px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 20px;
    gap: 0;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--border-color);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
  }

  .mobile-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .hero {
    height: 65vh;
  }

  .hero-content h1 {
    font-size: 28px;
  }

  .section-header h2 {
    font-size: 24px;
  }

  .services-page-header h1,
  .contact-page-header h1 {
    font-size: 30px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .contact-info-card,
  .contact-form-card {
    padding: 25px;
  }

  .navbar .container {
    flex-wrap: nowrap;
  }

  .navbar .logo {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .about,
  .services,
  .contact-section,
  .detail-services {
    padding: 50px 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .navbar .container {
    height: auto;
    padding: 15px 0;
    flex-direction: column;
    gap: 12px;
  }

  .navbar .logo {
    min-width: auto;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .btn-whatsapp {
    padding: 8px 14px;
    font-size: 13px;
    gap: 6px;
  }

  .btn-whatsapp span {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }
}
