/* ===== CSS VARIABLES ===== */
:root {
  /* TOKENS-V2 — هوية الموقع في مكان واحد. تغييرها هنا يغيّر الموقع كله. */

  /* الهوية الأساسية */
  --primary-color: #1A3A5C;      /* الكحلي — اللون الأساسي */
  --primary-dark:  #0F2A47;      /* كحلي أغمق (التدرّجات) */
  --accent-color:  #C9A84C;      /* الذهبي — لون التمييز */
  --accent-dark:   #B8932E;      /* ذهبي أغمق (تحويم الأزرار) */

  /* الخلفيات والنصوص */
  --bg-light:      #F5F7FA;
  --surface:       #FFFFFF;
  --text-dark:     #1A1A1A;
  --text-body:     #333333;
  --text-light:    #666666;
  --text-muted:    #5C6570;
  --border-color:  #E0E0E0;
  --border-soft:   #F0F0F0;

  /* الوضع الليلي */
  --dark-bg:      #0F1419;
  --dark-hero-2:  #1A2A3A;
  --dark-surface: #1A1A1A;
  --dark-text:    #F5F7FA;
  --dark-border:  #333333;

  /* الخطوط */
  --font-body:    'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: var(--font-body);
  --font-scale:   1;             /* مضاعِف حجم الخط العام */

  /* تدرّج الواجهة الأولى */
  --hero-gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);

  /* الظلال */
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  direction: rtl;
  text-align: right;
  background-color: #FFFFFF;
  color: var(--text-dark);
  line-height: 1.8;
  overflow-x: hidden;
  animation: pageLoad 0.3s ease-out;
}

@keyframes pageLoad {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== DARK MODE ===== */
body.dark-mode {
  background-color: #0F1419;
  color: var(--bg-light);
}
body.dark-mode .navbar          { background-color: var(--dark-bg); border-color: var(--dark-surface); }
body.dark-mode .hero            { background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-hero-2) 100%); }
body.dark-mode .card,
body.dark-mode .publication-card { background-color: var(--dark-surface); color: var(--dark-text); }
body.dark-mode .form-input,
body.dark-mode textarea         { background-color: var(--dark-surface); color: var(--dark-text); border-color: var(--dark-border); }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  letter-spacing: -0.5px;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 { color: var(--dark-text); }

p {
  margin-bottom: 1rem;
  color: var(--text-light);
  line-height: 1.8;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover { color: var(--accent-dark); }

img, video, iframe, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
}
.navbar-logo img { height: 50px; width: auto; object-fit: contain; }

.navbar-nav {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

.navbar-nav a {
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
  padding-bottom: 0.5rem;
}
.navbar-nav a:hover,
.navbar-nav a.active { color: var(--accent-color); }

.navbar-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-color);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--primary-color);
  transition: transform 0.3s ease;
  padding: 0.5rem;
}
.theme-toggle:hover { transform: rotate(20deg); }

/* ===== LANGUAGE SWITCHER ===== */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border-color);
}

.lang-link {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: inline-block;
}
.lang-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
  color: white !important;
}
.lang-link::after { display: none !important; }

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #FFFFFF;
  padding: 8rem 2rem;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: rgba(201, 168, 76, 0.05);
  border-radius: 50%;
  transform: translate(100px, -100px);
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: #FFFFFF;
  font-weight: 900;
  letter-spacing: -1px;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2.5rem;
  color: var(--border-color);
  position: relative;
  z-index: 1;
  font-weight: 400;
}

/* ===== HERO CONTAINER (Two-Column Layout) ===== */
.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-content h1 {
  font-size: 3.5rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}
.hero-content p {
  font-size: 1.3rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Photo Frame */
.hero-photo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 500px;
}

.photo-frame {
  position: relative;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  border: 8px solid var(--accent-color);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.3), 0 12px 32px rgba(0, 0, 0, 0.2);
  background: radial-gradient(circle at 30% 30%, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0.05));
  overflow: hidden;
  animation: photoSlideIn 0.6s ease-out forwards;
  will-change: transform, opacity;
}
body.dark-mode .photo-frame {
  background: radial-gradient(circle at 30% 30%, rgba(201, 168, 76, 0.1), rgba(201, 168, 76, 0.02));
}

.hero-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

@keyframes photoSlideIn {
  from { opacity: 0; transform: translateX(100px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Credential Badges */
.credential-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-color);
  color: var(--accent-color);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  animation: badgeFadeIn 0.5s ease-out forwards;
  will-change: transform, opacity;
}
body.dark-mode .credential-badge {
  background-color: rgba(201, 168, 76, 0.2);
  border: 1px solid var(--accent-color);
}

.badge-icon { font-size: 1.2rem; }
.badge-text { letter-spacing: 0.3px; }
.badge-1 { bottom: 20px; right: 20px; animation-delay: 0.8s; }
.badge-2 { top: 30px;   left: 20px;  animation-delay: 1.0s; }
.badge-3 { bottom: 80px; left: 20px; animation-delay: 1.2s; }

@keyframes badgeFadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* ===== CTA BUTTON ===== */
.cta-button {
  background-color: var(--accent-color);
  color: var(--primary-color);
  padding: 1.1rem 2.8rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-heading);
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
  user-select: none;
}
.cta-button:hover {
  background-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.4);
  color: var(--primary-color);
}

/* ===== STATS BAR ===== */
.stats-bar {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.stat-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
}
.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }
.stat-item:nth-child(4) { animation-delay: 0.4s; }

.stat-icon   { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.stat-counter {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  line-height: 1;
}
.stat-counter::after { content: '+'; margin-right: 0.3rem; }
.stat-item p { font-size: 1rem; color: var(--border-color); margin: 0; }

/* ===== SECTION STYLES ===== */
section {
  padding: 4.5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-weight: 900;
  letter-spacing: -0.5px;
}
body.dark-mode .section-title { color: var(--dark-text); }

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 3rem;
  font-weight: 400;
}

/* ===== BASE CARD ===== */
.card {
  background-color: #FFFFFF;
  border-radius: 6px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--border-soft);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card h3 { margin-bottom: 1rem; }
body.dark-mode .card { background-color: var(--dark-surface); color: var(--dark-text); }

/* ===== SERVICES SECTION ===== */
.services-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.services-category { margin-bottom: 4rem; }

.category-title {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--accent-color);
  text-align: center;
}
body.dark-mode .category-title { color: var(--dark-text); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

/* Service Card */
.service-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-color) 0%, rgba(201, 168, 76, 0.5) 100%);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.service-card:hover::before { transform: scaleX(1); transform-origin: left; }
.service-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--accent-color); }

.service-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  animation: iconBounce 0.6s ease-out;
}
@keyframes iconBounce {
  0%   { opacity: 0; transform: scale(0.5) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Support both h3 and h4 inside service-card */
.service-card h3,
.service-card h4 {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 0.8rem;
}
.service-card p  { color: var(--text-light); margin-bottom: 1.5rem; flex-grow: 1; }
.service-card ul { list-style: none; margin-bottom: 1.5rem; }
.service-card li {
  color: var(--text-light);
  /* RTL fix: padding on right, icon anchored to right */
  padding-right: 1.5rem;
  margin-bottom: 0.5rem;
  position: relative;
}
.service-card li::before {
  content: '✓';
  position: absolute;
  right: 0;           /* RTL: icon on the right */
  color: var(--accent-color);
  font-weight: bold;
}

.service-cta {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  text-decoration: none;
  align-self: flex-start;
}
.service-cta:hover { background-color: var(--accent-color); color: var(--primary-color); transform: translateX(-4px); }

body.dark-mode .service-card            { background-color: var(--dark-surface); border-color: var(--dark-border); color: var(--dark-text); }
body.dark-mode .service-card h3,
body.dark-mode .service-card h4         { color: var(--dark-text); }
body.dark-mode .service-card p,
body.dark-mode .service-card li         { color: #B8B8B8; }
body.dark-mode .service-cta             { background-color: var(--accent-color); color: var(--primary-color); }
body.dark-mode .service-cta:hover       { background-color: var(--primary-color); color: var(--accent-color); }

/* ===== PUBLICATION CARDS ===== */
.publications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

.publication-card {
  background-color: #FFFFFF;
  border-radius: 6px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--border-soft);
}
.publication-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-6px); }
body.dark-mode .publication-card { background-color: var(--dark-surface); color: var(--dark-text); }

.publication-card .badge {
  display: inline-block;
  background-color: var(--primary-color);
  color: #FFFFFF;
  padding: 0.4rem 1rem;
  border-radius: 3px;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  font-weight: 600;
}
.publication-card h3     { font-size: 1.3rem; margin-bottom: 0.75rem; font-weight: 700; }
.publication-card .year  { color: var(--accent-color); font-size: 0.9rem; margin-bottom: 0.75rem; font-weight: 600; }
.publication-card p      { color: var(--text-light); font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.7; }

.read-more { color: var(--accent-color); font-weight: 600; transition: color 0.3s ease, transform 0.3s ease; font-size: 0.95rem; }
.read-more:hover { color: var(--accent-dark); transform: translateX(-4px); }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding: 2rem 0; }

.timeline::before {
  content: '';
  position: absolute;
  right: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background-color: var(--accent-color);
}

.timeline-item { margin-bottom: 2.5rem; position: relative; }
.timeline-item:nth-child(odd)  { padding-right: 52%; }
.timeline-item:nth-child(even) { padding-left: 52%; }

.timeline-item::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background-color: var(--accent-color);
  border: 3px solid #FFFFFF;
  border-radius: 50%;
  top: 0;
  right: 50%;
  transform: translateX(6px);
  box-shadow: 0 0 0 3px var(--accent-color);
}

.timeline-content {
  background-color: var(--bg-light);
  padding: 2rem;
  border-radius: 6px;
  border-left: 3px solid var(--accent-color);
}
body.dark-mode .timeline-content { background-color: var(--dark-surface); }

.timeline-content h4 { color: var(--primary-color); margin-bottom: 0.75rem; font-weight: 700; }
.timeline-content p  { color: var(--text-light); font-size: 0.95rem; }

/* ===== SKILLS SECTION ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

.skill-card {
  background-color: #FFFFFF;
  padding: 2.5rem;
  border-radius: 6px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
}
body.dark-mode .skill-card { background-color: var(--dark-surface); }
.skill-card h3 { margin-bottom: 2rem; color: var(--primary-color); font-weight: 700; }

.skill-item   { margin-bottom: 2rem; }
.skill-label  { display: flex; justify-content: space-between; margin-bottom: 0.75rem; font-size: 0.9rem; }
.skill-label span:first-child { color: var(--text-dark); font-weight: 600; }
body.dark-mode .skill-label span:first-child { color: var(--dark-text); }
.skill-label span:last-child  { color: var(--accent-color); font-weight: 700; }

.progress-bar {
  width: 100%;
  height: 6px;
  background-color: #E8E8E8;
  border-radius: 3px;
  overflow: hidden;
}
body.dark-mode .progress-bar { background-color: var(--dark-border); }

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 3px;
  width: 0%;
  animation: fillProgress 1s ease-out forwards;
  animation-delay: 0.3s;
}
@keyframes fillProgress {
  to { width: var(--progress-width); }
}

/* ===== CERTIFICATIONS ===== */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
}

.cert-card {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #FFFFFF;
  padding: 2.5rem;
  border-radius: 6px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cert-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.cert-card h3 { color: var(--accent-color); margin-bottom: 1rem; font-size: 2.5rem; }
.cert-card h4 { color: #FFFFFF; margin-bottom: 0.5rem; font-size: 1.1rem; }

/* ===== FORM STYLES ===== */
.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.form-group { margin-bottom: 2rem; }
.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}
body.dark-mode .form-group label { color: var(--dark-text); }

.form-input,
textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: #FFFFFF;
  color: var(--text-dark);
}
.form-input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}
textarea { resize: vertical; min-height: 140px; }

body.dark-mode .form-input,
body.dark-mode textarea { background-color: var(--dark-surface); color: var(--dark-text); border-color: var(--dark-border); }

.contact-info { display: flex; flex-direction: column; gap: 1.5rem; }

.info-card {
  background-color: var(--bg-light);
  padding: 2rem;
  border-radius: 6px;
  border-right: 4px solid var(--accent-color);
}
body.dark-mode .info-card { background-color: var(--dark-surface); }
.info-card h4 { color: var(--primary-color); margin-bottom: 0.75rem; font-weight: 700; }
.info-card p  { color: var(--text-light); font-size: 0.95rem; }

/* ===== TESTIMONIALS SECTION ===== */
.testimonials-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.testimonials-header { text-align: center; margin-bottom: 3rem; }

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.testimonial-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--accent-color); }
body.dark-mode .testimonial-card { background-color: var(--dark-surface); border-color: var(--dark-border); color: var(--dark-text); }

.testimonial-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.testimonial-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sector-badge {
  display: inline-block;
  background-color: rgba(201, 168, 76, 0.1);
  color: var(--primary-color);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
body.dark-mode .sector-badge { background-color: rgba(201, 168, 76, 0.15); color: var(--accent-color); }

.star-rating { display: flex; gap: 0.3rem; margin-bottom: 1rem; direction: ltr; justify-content: flex-end; }
.star { font-size: 1.2rem; color: #CCCCCC; transition: color 0.2s ease; }
.star.filled { color: var(--accent-color); }

.testimonial-quote {
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  border-right: 3px solid var(--accent-color);
  padding-right: 1rem;
}
body.dark-mode .testimonial-quote { color: var(--dark-text); }

.testimonial-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.verification-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #27AE60;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== CREDENTIALS SECTION ===== */
.credentials-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
  background-color: var(--bg-light);
}
body.dark-mode .credentials-section { background-color: var(--dark-bg); }

.credentials-container { text-align: center; }

.credentials-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 2rem 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.credentials-scroll::-webkit-scrollbar        { height: 6px; }
.credentials-scroll::-webkit-scrollbar-track  { background: transparent; }
.credentials-scroll::-webkit-scrollbar-thumb  { background: var(--accent-color); border-radius: 3px; }

.credential-card {
  flex: 0 0 280px;
  background-color: #FFFFFF;
  border: 2px solid transparent;
  border-left: 4px solid var(--accent-color);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  will-change: transform;
}
.credential-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent-color); }
body.dark-mode .credential-card { background-color: var(--dark-surface); border-color: var(--accent-color); }

.credential-icon         { font-size: 3rem; margin-bottom: 1rem; display: block; }
.credential-card h3      { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--primary-color); }
.credential-institution  { font-size: 0.9rem; color: var(--text-light); margin-bottom: 0.5rem; font-weight: 500; }
.credential-year         { font-size: 0.85rem; color: var(--accent-color); font-weight: 700; margin-bottom: 0.5rem; }
.credential-detail       { font-size: 0.8rem; color: var(--text-light); font-style: italic; }

.credential-placeholder {
  border-style: dashed;
  border-left-style: dashed;
  opacity: 0.7;
  background-color: rgba(245, 247, 250, 0.5);
}
.credential-placeholder:hover    { opacity: 1; background-color: #FFFFFF; }
body.dark-mode .credential-placeholder       { background-color: rgba(26, 26, 26, 0.5); }
body.dark-mode .credential-placeholder:hover { background-color: var(--dark-surface); }

/* ===== FOOTER ===== */
.footer {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
  position: relative;
}
body.dark-mode .footer { background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-hero-2) 100%); }

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-trust-section {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(201, 168, 76, 0.15);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  border: 1px solid var(--accent-color);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.trust-badge:hover { background-color: rgba(201, 168, 76, 0.25); transform: translateY(-2px); }
body.dark-mode .trust-badge { background-color: rgba(201, 168, 76, 0.1); }

.footer-section { display: flex; flex-direction: column; }
.footer-section h4    { color: var(--accent-color); margin-bottom: 1rem; font-size: 1.1rem; }
.footer-section ul    { list-style: none; }
.footer-section li    { margin-bottom: 0.5rem; }
.footer-section a     { color: var(--border-color); transition: color 0.3s ease, transform 0.3s ease; display: inline-block; }
.footer-section a:hover { color: var(--accent-color); transform: translateX(-4px); }
body.dark-mode .footer-section a       { color: #D0D0D0; }
body.dark-mode .footer-section a:hover { color: var(--accent-color); }

.footer-info p { color: var(--border-color); margin-bottom: 1rem; line-height: 1.6; font-size: 0.95rem; }

.social-links { display: flex; gap: 1rem; }
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background-color: rgba(201, 168, 76, 0.15);
  border-radius: 50%;
  color: var(--accent-color);
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.social-links a:hover { background-color: var(--accent-color); color: var(--primary-color); transform: translateY(-4px); }

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-bottom p { margin: 0; color: var(--text-muted); }

/* WhatsApp Floating Button */
.whatsapp-button {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 60px; height: 60px;
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1000;
  text-decoration: none;
  will-change: transform;
}
.whatsapp-button:hover {
  background-color: #20BA5A;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}
.whatsapp-button svg { width: 28px; height: 28px; }

/* ===== ACCORDION ===== */
.accordion {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}
body.dark-mode .accordion { border-color: var(--dark-border); }

.accordion-header {
  background-color: var(--bg-light);
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  transition: background-color 0.3s ease;
  user-select: none;
}
body.dark-mode .accordion-header        { background-color: var(--dark-surface); }
.accordion-header:hover                  { background-color: #EEEEEE; }
body.dark-mode .accordion-header:hover  { background-color: #2A2A2A; }

.accordion-icon {
  color: var(--accent-color);
  transition: transform 0.3s ease;
  font-size: 1.2rem;
}
.accordion-header.active .accordion-icon { transform: rotate(180deg); }

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background-color: #FFFFFF;
  padding: 0 1.5rem;
}
body.dark-mode .accordion-content { background-color: var(--dark-bg); }

.accordion-header.active ~ .accordion-content {
  max-height: 500px;
  padding: 1.5rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.fade-in { animation: fadeInUp 0.6s ease-out forwards; opacity: 0; }
.fade-in.visible { opacity: 1; animation: fadeInUp 0.6s ease-out; }

/* ===== ACCESSIBILITY ===== */
:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar        { width: 8px; height: 8px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--accent-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }
* { scrollbar-color: var(--accent-color) transparent; scrollbar-width: thin; }

/* ===== PERFORMANCE — Reduce Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .navbar, .footer, .whatsapp-button, .theme-toggle { display: none; }
  body { background-color: white; color: black; }
  a { color: black; text-decoration: underline; }
}

/* ===== HIGH DPI ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
}

/* ===== RESPONSIVE — 768px ===== */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .navbar-nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .navbar-logo img { height: 40px; }

  .hero { padding: 4rem 1rem; min-height: 400px; }
  .hero h1 { font-size: 2.2rem; }
  .hero p  { font-size: 1rem; }

  .hero-container { grid-template-columns: 1fr; gap: 2rem; padding: 2rem 1rem; }
  .hero-content h1 { font-size: 2.2rem; }
  .hero-content p  { font-size: 1.1rem; }
  .hero-photo-wrapper { height: 350px; margin-top: 2rem; }
  .photo-frame { width: 280px; height: 280px; }
  .credential-badge { font-size: 0.75rem; padding: 0.5rem 1rem; }
  .badge-1 { bottom: 10px; right: 10px; }
  .badge-2 { top: 10px;   left: 10px; }
  .badge-3 { bottom: 60px; left: 10px; }

  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; padding: 2rem 1rem; }
  .stat-counter { font-size: 2rem; }
  .stat-icon { font-size: 2rem; }
  .stat-item p { font-size: 0.9rem; }

  section { padding: 2.5rem 1rem; }
  .section-title { font-size: 2rem; }

  .services-section { padding: 2rem 1rem; }
  .services-category { margin-bottom: 2.5rem; }
  .category-title { font-size: 1.4rem; margin-bottom: 1.5rem; }
  .services-grid { grid-template-columns: 1fr !important; }
  .service-card { padding: 1.5rem; }
  .service-icon { font-size: 2.5rem; }

  .publications-grid,
  .skills-grid,
  .certifications-grid { grid-template-columns: 1fr; }

  .contact-section { grid-template-columns: 1fr; gap: 2rem; }

  .timeline::before { right: 0; }
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) { padding-right: 0; padding-left: 2rem; }
  .timeline-item::before { right: auto; left: -7px; transform: translateX(0); }

  .testimonials-section { padding: 2rem 1rem; }
  .testimonials-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .testimonial-card { padding: 1.5rem; }

  .credentials-section { padding: 2rem 1rem; }
  .credentials-scroll { gap: 1rem; padding: 1.5rem 0; }
  .credential-card { flex: 0 0 240px; padding: 1.5rem; }
  .credential-icon { font-size: 2.5rem; }

  .footer { padding: 2rem 1rem 1rem; }
  .footer-content { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-trust-section { gap: 1rem; }
  .trust-badge { font-size: 0.8rem; padding: 0.5rem 1rem; }
  .whatsapp-button { bottom: 1.5rem; left: 1.5rem; width: 50px; height: 50px; }
  .whatsapp-button svg { width: 24px; height: 24px; }
}

/* ===== RESPONSIVE — 480px ===== */
@media (max-width: 480px) {
  body { font-size: 14px; }
  .navbar { padding: 0.75rem; }
  .navbar-nav { gap: 0.5rem; }
  .navbar-logo img { height: 35px; }

  .hero h1 { font-size: 1.5rem; }
  .hero p  { font-size: 0.9rem; }
  .cta-button { padding: 0.9rem 1.5rem; font-size: 0.9rem; }

  .hero-container { padding: 1.5rem 1rem; }
  .hero-content h1 { font-size: 1.8rem; }
  .hero-content p  { font-size: 1rem; }
  .hero-photo-wrapper { height: 280px; }
  .photo-frame { width: 220px; height: 220px; border-width: 6px; }
  .credential-badge { display: none; }

  .stats-bar { grid-template-columns: 1fr; gap: 1rem; padding: 1.5rem 1rem; }
  .stat-counter { font-size: 1.8rem; }
  .stat-icon { font-size: 1.8rem; }

  .section-title { font-size: 1.5rem; }

  .service-card { padding: 1rem; }
  .service-icon { font-size: 2rem; }
  .service-card h3,
  .service-card h4 { font-size: 1rem; }

  .credential-card { flex: 0 0 200px; padding: 1rem; }
  .credential-icon { font-size: 2rem; }
  .credential-card h3 { font-size: 1rem; }

  .footer-trust-section { flex-direction: column; gap: 0.8rem; }
  .trust-badge { justify-content: center; }
  .whatsapp-button { bottom: 1rem; left: 1rem; width: 45px; height: 45px; }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
  button, a, .cta-button, .service-cta {
    min-height: 44px;
    min-width: 44px;
  }
  .service-card:hover    { transform: none; }
  .whatsapp-button:hover { transform: scale(1.05); }
}

/* ===== LAZY LOAD SUPPORT ===== */
img[loading="lazy"] { background-color: var(--border-soft); }
body.dark-mode img[loading="lazy"] { background-color: var(--dark-border); }

/* ===== CONTAINER QUERIES (Progressive Enhancement) ===== */
@supports (container-type: inline-size) {
  .service-card,
  .testimonial-card,
  .credential-card { container-type: inline-size; }
}

/* ===== RESPONSIVE-FIX — تجاوب الصفحة الأولى =====
   hero-avatar: اسم فريد (hero-photo محجوز في القالب).
   الأسبقية مرفوعة عمدًا لتتجاوز قواعد القالب مثل «.hero h1». */
.split-2{display:grid;grid-template-columns:1fr 1fr;gap:4rem;align-items:center;max-width:1400px;margin:0 auto;width:100%}
.split-2.pad{padding:4rem 2rem}
.hero .hero-avatar,.hero-avatar{position:relative;flex:0 0 auto;width:min(320px,68vw);height:min(320px,68vw);margin:0 auto}
.hero-avatar > div{width:100%;height:100%}
.hero h1.hero-title{font-size:clamp(1.75rem,5.2vw,3.5rem);font-weight:900;margin-bottom:1rem;color:#fff;line-height:1.25;text-wrap:balance}
@media (max-width:820px){
  .split-2{grid-template-columns:1fr;gap:2.25rem}
  .split-2.pad{padding:2.5rem 1.25rem}
  .hero{padding:2.75rem 1.25rem !important;min-height:auto !important}
  .hero-text{text-align:center !important}
}
