/* ============================================
   علي الجابر – Elite Fitness Coach Portfolio
   style.css  –  Full rewrite with all fixes
   ============================================ */

/* ============================================
   CSS VARIABLES / THEMES
   ============================================ */
:root {
  --accent:        #e8ff00;
  --accent-dark:   #c8de00;
  --accent-glow:   rgba(232,255,0,0.18);
  --bg-primary:    #0a0a0a;
  --bg-secondary:  #111111;
  --bg-card:       #161616;
  --bg-card-hover: #1e1e1e;
  --text-primary:  #f0f0f0;
  --text-secondary:#999;
  --text-muted:    #555;
  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(232,255,0,0.3);
  --shadow-card:   0 8px 32px rgba(0,0,0,0.4);
  --shadow-accent: 0 0 30px rgba(232,255,0,0.15);
  --font-heading:  'Poppins', sans-serif;
  --font-body:     'Open Sans', sans-serif;
  --radius:        12px;
  --radius-lg:     20px;
  --nav-height:    72px;
  --transition:    0.3s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg-primary:    #f8f8f6;
  --bg-secondary:  #eeeee8;
  --bg-card:       #ffffff;
  --bg-card-hover: #f4f4ee;
  --text-primary:  #0a0a0a;
  --text-secondary:#555;
  --text-muted:    #aaa;
  --border:        rgba(0,0,0,0.07);
  --border-accent: rgba(100,120,0,0.25);
  --shadow-card:   0 8px 32px rgba(0,0,0,0.1);
  --shadow-accent: 0 0 30px rgba(100,120,0,0.1);
  --accent:        #6b8000;
  --accent-dark:   #4a5800;
  --accent-glow:   rgba(100,120,0,0.12);
}

/* RTL: switch fonts */
[dir="rtl"] {
  --font-heading: 'Cairo', sans-serif;
  --font-body:    'Tajawal', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; padding: 0; margin: 0; }

/* ============================================
   UTILITY
   ============================================ */
.section-pad { padding: 100px 0; }
.section-alt  { background: var(--bg-secondary); }

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 6px 14px;
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  margin-bottom: 16px;
  background: var(--accent-glow);
}

/* Reduce letter-spacing on Arabic */
[dir="rtl"] .section-label { letter-spacing: 0.05em; }

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.section-title em { font-style: normal; color: var(--accent); }

.section-body {
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 12px;
  font-size: 0.97rem;
}

/* ============================================
   NAVBAR
   ============================================ */
#mainNavbar {
  height: var(--nav-height);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, height 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  z-index: 1000;
}

#mainNavbar.scrolled {
  height: 58px;
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

[data-theme="light"] #mainNavbar.scrolled {
  background: rgba(248,248,246,0.92);
}

/* Brand */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 900;
  letter-spacing: 0.04em;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.brand-icon   { color: var(--accent); font-size: 1.3rem; line-height: 1; }
.brand-text   { color: var(--text-primary); }
.brand-accent { color: var(--accent); }

/* Nav links list — push to far end in both directions */
#navLinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  /* Desktop LTR: push right */
  margin-left: auto !important;
  margin-right: 0 !important;
}

[dir="rtl"] #navLinks {
  /* Desktop RTL: push left */
  margin-left: 0 !important;
  margin-right: auto !important;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary) !important;
  padding: 7px 10px !important;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

[dir="rtl"] .nav-link { letter-spacing: 0.02em; }

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary) !important;
  background: var(--border);
}

/* Controls group */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-inline-start: 12px;
}

/* Hamburger */
.navbar-toggler {
  border: none;
  background: none;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  margin-inline-start: auto; /* push to end on mobile */
}

.navbar-toggler:focus { box-shadow: none; outline: 2px solid var(--accent); border-radius: 4px; }

.hamburger-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Lang / Theme buttons */
.lang-btn {
  background: var(--border);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lang-btn:hover { color: var(--accent); border-color: var(--accent); }

.theme-btn {
  background: var(--border);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  min-height: 100vh;
  min-height: 100svh; /* small viewport height for mobile browsers */
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--bg-primary);
  /* Parallax disabled globally — enabled only on large screens via media query */
  background-image:
    linear-gradient(to bottom, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.92) 100%),
    url('https://images.unsplash.com/photo-1517836357463-d25dfeac3438?w=1600&q=80&fm=webp');
  background-size: cover;
  background-position: center top;
  background-attachment: scroll; /* safe default — overridden on desktop below */
}

[data-theme="light"] .hero-section {
  background-image:
    linear-gradient(to bottom, rgba(248,248,246,0.5) 0%, rgba(248,248,246,0.92) 100%),
    url('https://images.unsplash.com/photo-1517836357463-d25dfeac3438?w=1600&q=80&fm=webp');
}

.hero-bg-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(232,255,0,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: calc(var(--nav-height) + 48px);
  padding-bottom: 80px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

[dir="rtl"] .hero-tag { letter-spacing: 0.04em; }

.tag-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.6; }
}

.hero-headline {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--text-primary);
  /* Negative letter-spacing breaks Arabic — use logical conditional */
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

[dir="rtl"] .hero-headline { letter-spacing: 0; }

.hero-headline em { font-style: italic; color: var(--accent); }
[dir="rtl"] .hero-headline em { font-style: normal; }

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 460px;
  margin-bottom: 36px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

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

.stat-num {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

[dir="rtl"] .stat-label { letter-spacing: 0.02em; }

.hero-stat-divider { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

.hero-scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}

.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-anim 2s ease-in-out infinite;
}

@keyframes scroll-anim {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary-accent {
  background: var(--accent);
  color: #0a0a0a;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 100px;
  border: 2px solid var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

[dir="rtl"] .btn-primary-accent { letter-spacing: 0.02em; }

.btn-primary-accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #0a0a0a;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-outline-accent {
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 100px;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

[dir="rtl"] .btn-outline-accent { letter-spacing: 0.02em; }

.btn-outline-accent:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-img-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
  /* Extra bottom padding so the badge doesn't clip */
  padding-bottom: 30px;
}

.about-img-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.about-img-frame::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent 60%);
  z-index: 1;
  pointer-events: none;
}

.about-img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(20%);
  transition: filter 0.4s ease;
}

.about-img-frame:hover .about-img { filter: grayscale(0%); }

.about-exp-badge {
  position: absolute;
  bottom: 0;
  /* LTR: bottom-right inside the wrap */
  right: 0;
  background: var(--accent);
  color: #0a0a0a;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 3;
}

/* RTL: bottom-left */
[dir="rtl"] .about-exp-badge { right: auto; left: 0; }

.badge-num   { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 900; line-height: 1; }
.badge-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-align: center; white-space: nowrap; }

.about-stats .astat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.astat-box:hover { border-color: var(--accent); transform: translateY(-3px); }

.astat-num   { font-family: var(--font-heading); font-size: 1.9rem; font-weight: 900; color: var(--accent); line-height: 1; }
.astat-plus  { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 900; color: var(--accent); }
.astat-label { display: block; font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }

[dir="rtl"] .astat-label { letter-spacing: 0.01em; }

/* ============================================
   SERVICES SECTION
   ============================================ */
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.service-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: inline-start; /* respects RTL */
  transition: transform 0.3s ease;
}

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

.service-card:hover::before { transform: scaleX(1); }

.service-icon {
  width: 56px; height: 56px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 20px;
  transition: background 0.25s ease, transform 0.25s ease, color 0.25s ease;
  flex-shrink: 0;
}

.service-card:hover .service-icon {
  background: var(--accent);
  color: #0a0a0a;
  transform: rotate(-5deg) scale(1.05);
}

.service-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.service-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex: 1;
  margin-bottom: 20px;
  line-height: 1.65;
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  transition: gap 0.25s ease;
}

[dir="rtl"] .service-link { letter-spacing: 0.01em; }
.service-link:hover { gap: 10px; }

/* ============================================
   PROGRAMS SECTION
   ============================================ */
.program-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.program-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
}

.program-featured {
  border-color: var(--border-accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(232,255,0,0.03) 100%);
  box-shadow: var(--shadow-accent);
}

.featured-badge {
  position: absolute;
  top: -1px;
  /* LTR: right-side tab */
  right: 24px;
  background: var(--accent);
  color: #0a0a0a;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 0 0 10px 10px;
}

[dir="rtl"] .featured-badge { right: auto; left: 24px; letter-spacing: 0.02em; }

.program-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.program-tag {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border-accent);
}

[dir="rtl"] .program-tag { letter-spacing: 0.02em; }

.program-duration {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.program-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.program-benefits { flex: 1; margin-bottom: 24px; display: flex; flex-direction: column; gap: 10px; }

.program-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.program-benefits li .fa-check {
  color: var(--accent);
  margin-top: 4px;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.program-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price-amount  { font-family: var(--font-heading); font-size: 2rem; font-weight: 900; color: var(--text-primary); }
.price-period  { font-size: 0.85rem; color: var(--text-muted); }

/* ============================================
   CERTIFICATIONS
   ============================================ */
.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  height: 100%;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.cert-card:hover,
.cert-card:focus {
  transform: translateY(-6px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card), var(--shadow-accent);
  outline: none;
}

.cert-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-lg); }

.cert-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 16px;
  transition: transform 0.25s ease;
}

.cert-card:hover .cert-icon { transform: scale(1.15) rotate(-5deg); }

.cert-name { font-family: var(--font-heading); font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.cert-org  { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }
.cert-year { font-size: 0.7rem; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; font-family: var(--font-heading); }

/* Modal */
.cert-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: 48px 32px;
  color: var(--text-primary);
  position: relative;
}

.cert-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--border);
  border: none;
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.cert-modal-close:hover { background: var(--accent); color: #0a0a0a; }

.cert-modal-icon  { font-size: 3.5rem; color: var(--accent); margin-bottom: 20px; }
.cert-modal-title { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 800; margin-bottom: 10px; }
.cert-modal-org   { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 6px; }
.cert-modal-year  { color: var(--accent); font-family: var(--font-heading); font-weight: 700; font-size: 0.85rem; margin-bottom: 20px; }

.cert-modal-bar {
  width: 60px; height: 3px;
  background: var(--accent);
  border-radius: 3px;
  margin: 0 auto;
}

/* ============================================
   GALLERY
   ============================================ */
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 3 / 4;
  cursor: pointer;
  /* Prevent CLS by reserving space */
  background: var(--bg-card);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(30%);
  transition: transform 0.5s ease, filter 0.5s ease;
}

.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex; align-items: flex-end;
  padding: 18px;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-item:hover img { transform: scale(1.07); filter: grayscale(0%); }

.gallery-caption {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

[dir="rtl"] .gallery-caption { letter-spacing: 0.01em; }

/* ============================================
   TESTIMONIALS — complete rewrite
   ============================================ */

/* Outer wrapper: contains slider + controls */
.testi-wrapper {
  max-width: 740px;
  margin: 0 auto;
  position: relative;
}

/* The overflow-hidden viewport */
.testimonial-slider {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

/* The moving strip — ALWAYS LTR so slide order never reverses in RTL.
   RTL offset is handled by JS flipping the sign of translateX. */
.testi-track {
  display: flex;
  direction: ltr;
  width: 100%;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* Each slide takes exactly 100% of the viewport */
.testi-slide {
  min-width: 100%;
  width: 100%;
  flex-shrink: 0;
  padding: 0 4px;
}

.testi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  /* text-align respects RTL automatically via start */
  text-align: start;
}

/* Stars — always LTR so they don't flip in RTL */
.testi-stars {
  display: flex;
  gap: 4px;
  direction: ltr;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.testi-text {
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: normal;
  line-height: 1.85;
  margin-bottom: 28px;
  position: relative;
  padding-inline-start: 28px;
}

/* Decorative opening quote */
.testi-text::before {
  content: '\201C'; /* " */
  font-family: Georgia, serif;
  font-size: 4.5rem;
  color: var(--accent);
  opacity: 0.25;
  position: absolute;
  top: -24px;
  inset-inline-start: -6px;
  line-height: 1;
  pointer-events: none;
}

/* Arabic opening quote goes on the right */
[dir="rtl"] .testi-text::before { content: '\201D'; } /* " */

.testi-client {
  display: flex;
  align-items: center;
  gap: 14px;
}

.testi-client img {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-accent);
  flex-shrink: 0;
}

.testi-name { display: block; font-family: var(--font-heading); font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.testi-role { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* Controls row: prev | dots | next */
.testi-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.testi-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.testi-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.testi-dots { display: flex; gap: 8px; align-items: center; }

.testi-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: 1px solid var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s ease, width 0.25s ease, border-radius 0.25s ease;
}

.testi-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  width: 24px;
  border-radius: 4px;
}

/* ============================================
   CONTACT FORM
   ============================================ */
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.form-group-custom { position: relative; }

.form-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 16px 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input.error { border-color: #ff4d4d; }

/* Floating label */
.form-label-float {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  /* LTR: anchor left */
  left: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: top 0.2s ease, font-size 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* RTL: anchor right */
[dir="rtl"] .form-label-float { left: auto; right: 16px; }

/* Float up when filled / focused */
.form-input:focus + .form-label-float,
.form-input:not(:placeholder-shown) + .form-label-float {
  top: 9px;
  transform: translateY(0);
  font-size: 0.67rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

[dir="rtl"] .form-input:focus + .form-label-float,
[dir="rtl"] .form-input:not(:placeholder-shown) + .form-label-float {
  letter-spacing: 0;
}

/* Textarea specifics */
.form-textarea { resize: vertical; min-height: 110px; padding-top: 28px; }
.form-textarea + .form-label-float { top: 20px; transform: translateY(0); }

.form-textarea:focus + .form-label-float,
.form-textarea:not(:placeholder-shown) + .form-label-float {
  top: 8px;
  font-size: 0.67rem;
  color: var(--accent);
}

/* Select: label sits at top always (value chosen) */
.form-label-select { top: 50%; }
.form-select-custom option { background: var(--bg-card); color: var(--text-primary); }

.form-error {
  font-size: 0.72rem;
  color: #ff4d4d;
  margin-top: 4px;
  min-height: 18px;
  display: block;
}

/* Contact info */
.contact-info { display: flex; flex-direction: column; gap: 16px; }

.cinfo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cinfo-item i      { color: var(--accent); width: 20px; text-align: center; flex-shrink: 0; margin-top: 3px; }
.cinfo-item a      { color: var(--text-secondary); transition: color 0.2s ease; }
.cinfo-item a:hover{ color: var(--accent); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 64px 0 0;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.footer-tagline { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 20px; }

.footer-socials { display: flex; gap: 10px; }

.social-link {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social-link:hover { background: var(--accent); color: #0a0a0a; border-color: var(--accent); transform: translateY(-3px); }

.footer-heading {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 18px;
}

[dir="rtl"] .footer-heading { letter-spacing: 0.02em; }

.footer-links { display: flex; flex-direction: column; gap: 10px; }

.footer-links li,
.footer-links a { font-size: 0.85rem; color: var(--text-muted); transition: color 0.2s ease; }

.footer-links a:hover { color: var(--accent); }

.footer-links li { display: flex; align-items: flex-start; gap: 8px; }
.footer-links li i { flex-shrink: 0; margin-top: 4px; color: var(--accent); }

.footer-top    { padding-bottom: 48px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
}

.footer-bottom p { font-size: 0.78rem; color: var(--text-muted); margin: 0; }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  /* LTR: bottom-right */
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

/* RTL: bottom-left */
[dir="rtl"] .toast-container { right: auto; left: 24px; }

.toast-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  min-width: 260px;
  max-width: 340px;
  pointer-events: all;
  animation: toastSlideIn 0.35s cubic-bezier(0.4,0,0.2,1) forwards;
}

.toast-item.success { border-color: rgba(100,220,100,0.35); }
.toast-item.error   { border-color: rgba(255,80,80,0.35); }

.toast-item i { font-size: 1.1rem; flex-shrink: 0; }
.toast-item.success i { color: #64dc64; }
.toast-item.error   i { color: #ff5050; }

.toast-item.removing { animation: toastSlideOut 0.3s forwards; }

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

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

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.7s ease forwards;
}

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

.reveal-up    { opacity: 0; transform: translateY(40px);  transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-left  { opacity: 0; transform: translateX(-40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-right { opacity: 0; transform: translateX(40px);  transition: opacity 0.7s ease, transform 0.7s ease; }

.revealed { opacity: 1 !important; transform: none !important; }

/* ============================================
   FOCUS STYLES (accessibility)
   ============================================ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================
   RESPONSIVE — TABLET  (≤ 991px)
   ============================================ */
@media (min-width: 992px) {
  /* Parallax only on desktop — safe from iOS bug */
  .hero-section { background-attachment: fixed; }

  /* Desktop navbar layout */
  .navbar-collapse {
    display: flex !important;
    align-items: center;
    flex-grow: 1;
  }
}

@media (max-width: 991px) {
  .section-pad { padding: 72px 0; }

  /* Mobile nav drawer */
  .navbar-collapse {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 10px;
    border: 1px solid var(--border);
    max-height: 80vh;
    overflow-y: auto;
  }

  #navLinks {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    margin: 0 !important;
  }

  #navLinks .nav-item { width: 100%; }
  #navLinks .nav-link { width: 100%; padding: 10px 14px !important; }

  .nav-controls {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 8px;
    margin-inline-start: 0;
    width: 100%;
  }

  .about-exp-badge { bottom: 0; right: 16px; }
  [dir="rtl"] .about-exp-badge { right: auto; left: 16px; }

  .about-img { height: 380px; }

  .testi-card { padding: 32px 24px; }
}

/* ============================================
   RESPONSIVE — MOBILE  (≤ 767px)
   ============================================ */
@media (max-width: 767px) {
  :root { --nav-height: 60px; }

  .hero-section {
    background-attachment: scroll; /* Critical iOS fix */
    min-height: 100svh;
  }

  .hero-content {
    padding-top: calc(var(--nav-height) + 28px);
    padding-bottom: 80px;
    text-align: center;
  }

  .hero-headline { font-size: clamp(2rem, 10vw, 2.8rem); }

  .hero-sub {
    margin-inline: auto;
    font-size: 0.95rem;
  }

  .hero-cta   { justify-content: center; }
  .hero-stats { justify-content: center; gap: 16px; }
  .hero-stat  { align-items: center; }
  .hero-tag   { margin-inline: auto; }

  .hero-scroll-hint { display: none; }

  .section-title { font-size: clamp(1.7rem, 6vw, 2.4rem); }

  /* About image shorter on mobile */
  .about-img { height: 280px; }
  .about-img-wrap { padding-bottom: 28px; }
  .about-exp-badge { bottom: 0; right: 12px; padding: 12px 14px; }
  [dir="rtl"] .about-exp-badge { right: auto; left: 12px; }
  .badge-num { font-size: 1.4rem; }

  .contact-form { padding: 28px 20px; }

  .testi-card  { padding: 28px 20px; }
  .testi-text  { font-size: 0.95rem; }
  .testi-wrapper { max-width: 100%; }

  .program-featured { margin-top: 0; }
}

/* ============================================
   RESPONSIVE — SMALL MOBILE  (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn-primary-accent,
  .btn-outline-accent { width: 100%; justify-content: center; }

  .toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast-item { min-width: unset; max-width: 100%; }

  .cert-card { padding: 22px 12px; }
  .testi-card { padding: 24px 16px; }

  .price-amount { font-size: 1.7rem; }
}
