/**
 * ╔══════════════════════════════════════════════════════════════════╗
 * ║  VIBE DESIGN SYSTEM — Universal Visual Consistency Layer        ║
 * ║  Applied to ALL pages — overrides inconsistencies               ║
 * ║  Philosophy: Apple-tier, Awwwards-worthy, zero compromise       ║
 * ╚══════════════════════════════════════════════════════════════════╝
 */

/* ── SPACING SCALE TOKENS ─────────────────────────────────────────────────── */
:root {
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-pill: 999px;

  --shadow-glass: 0 8px 32px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.05) inset;
  --shadow-glow:  0 0 40px rgba(163,207,43,0.12);

  --transition-spring: 0.3s cubic-bezier(0.34,1.56,0.64,1);
  --transition-smooth: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── GLOBAL RESETS & FOUNDATION ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg, #021a1e);
  color: var(--text, #f1f5f9);
  font-family: 'Cairo', 'Tajawal', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── RTL/LTR LANGUAGE SWITCH ─────────────────────────────────────────────── */
/* Arabic — RTL + Cairo */
html.lang-ar body,
html[dir="rtl"] body {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  direction: rtl;
  text-align: right;
}

/* English — LTR + Outfit */
html.lang-en body,
html[dir="ltr"] body {
  font-family: 'Outfit', 'Space Grotesk', 'Inter', sans-serif;
  direction: ltr;
  text-align: left;
}

/* Nav always LTR regardless of page language */
html.lang-en .vibe-nav,
html.lang-en .vibe-nav * { direction: ltr; }
html.lang-ar .vibe-nav,
html.lang-ar .vibe-nav * { direction: ltr; }

/* Flip nav link order for AR vs EN */
html.lang-ar .vibe-nav-inner { direction: ltr; }
html.lang-en .vibe-nav-inner { direction: ltr; }

img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }

/* ── SECTION STANDARD (non-hero only) ───────────────────────────────────── */
.section {
  padding: clamp(60px, 8vw, 120px) clamp(20px, 5vw, 80px);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

/* ── SECTION LABELS ──────────────────────────────────────────────────────── */
.section-tag,
.srv-hero-tag,
.port-tag,
.courses-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(163, 207, 43, 0.08);
  border: 1px solid rgba(163, 207, 43, 0.2);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: clamp(0.72rem, 1.2vw, 0.82rem);
  font-weight: 600;
  color: #a3cf2b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* ── SECTION TITLES ──────────────────────────────────────────────────────── */
.section-title,
h2.section-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text, #f1f5f9);
  margin-bottom: 12px;
}

.section-desc,
p.section-desc {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--text-2, #94a3b8);
  line-height: 1.8;
  max-width: 640px; /* wider for Arabic text rhythm */
}

/* ── UNIFIED BUTTON SYSTEM ──────────────────────────────────────────────── */
.btn-primary,
a.btn-primary,
button.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, #a3cf2b 0%, #00897b 100%);
  color: #021a1e;
  font-weight: 800;
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-spring),
              box-shadow var(--transition-smooth),
              filter var(--transition-smooth);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 32px rgba(163,207,43,0.35), 0 2px 8px rgba(0,0,0,0.3);
  filter: brightness(1.08);
  color: #021a1e;
}
.btn-primary:active  { transform: scale(0.97); }
.btn-primary:focus-visible {
  outline: 2px solid #a3cf2b;
  outline-offset: 3px;
}

.btn-outline,
a.btn-outline,
button.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.88);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  padding: 13px 28px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: all var(--transition-spring);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.btn-outline:hover {
  background: rgba(163,207,43,0.08);
  border-color: rgba(163,207,43,0.4);
  color: #a3cf2b;
  transform: translateY(-2px);
}
.btn-outline:focus-visible {
  outline: 2px solid #a3cf2b;
  outline-offset: 3px;
}

/* ── GLASS CARD SYSTEM ───────────────────────────────────────────────────── */
.glass-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  transition: border-color var(--transition-smooth),
              transform var(--transition-smooth),
              box-shadow var(--transition-smooth);
}
.glass-card:hover {
  border-color: rgba(163,207,43,0.22);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.32), var(--shadow-glow);
}

/* ── HERO PADDING FIX — Remove double nav clearance ─────────────────────── */
/* vibe-os.min.css sets padding-top: calc(72px + 40px) = 112px on .hero
   PLUS body gets padding-top: 90px from vibe-body-offset = 202px total gap.
   Fix: reset hero padding-top since body offset already clears the nav. */
body .hero,
.vibe-body-offset .hero {
  padding-top: 40px;
  min-height: 100dvh;
}
.srv-hero,
.port-hero,
.courses-hero,
.contact-hero {
  min-height: 60vh;
}

/* ── GRADIENT TEXT UTILITY ───────────────────────────────────────────────── */
.text-gradient,
.title-accent,
.gradient-text {
  background: linear-gradient(135deg, #a3cf2b 0%, #00e0c6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ── HIGHLIGHT ACCENT ────────────────────────────────────────────────────── */
.vibe-highlight {
  color: #a3cf2b;
  font-weight: 800;
}

/* ── SCROLL REVEAL SYSTEM ────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1),
              transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.reveal.visible,
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
.reveal[data-delay="5"] { transition-delay: 0.5s; }

/* ── AMBIENT BACKGROUND ORBS ─────────────────────────────────────────────── */
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  animation: orbPulse 8s ease-in-out infinite alternate;
}
.ambient-orb-lime  { background: rgba(163,207,43,0.07); }
.ambient-orb-teal  { background: rgba(0,137,123,0.06); }
.ambient-orb-cyan  { background: rgba(0,224,198,0.05); }

/* opacity alone triggers Composite — use filter:brightness for GPU perf */
@keyframes orbPulse {
  from { filter: brightness(0.6); }
  to   { filter: brightness(1);   }
}

/* ── STAT COUNTERS — Unified ─────────────────────────────────────────────── */
.stat-item-v2 {
  text-align: center;
  padding: 0 24px;
}
.stat-num-v2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 900;
  color: #a3cf2b;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.stat-label-v2 {
  font-size: clamp(0.8rem, 1vw, 0.875rem);
  color: var(--text-2, #94a3b8);
  margin-top: 6px;
  letter-spacing: 0.03em;
  line-height: 1.4;
}
.stat-divider-v2 {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.08);
  align-self: center;
}

/* ── UNIFIED FORM INPUTS ─────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
textarea,
select {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: var(--text, #f1f5f9);
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: rgba(163,207,43,0.5);
  box-shadow: 0 0 0 3px rgba(163,207,43,0.1);
}
input::placeholder, textarea::placeholder {
  color: rgba(255,255,255,0.42); /* min 3:1 on dark bg */
}

/* ── FOCUS-VISIBLE GLOBAL RING ───────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid rgba(163,207,43,0.8);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Inputs use box-shadow focus instead */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
}

/* ── SCROLLBAR DESIGN ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(163,207,43,0.3);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(163,207,43,0.6); }

/* ── SELECTION ───────────────────────────────────────────────────────────── */
::selection {
  background: rgba(163,207,43,0.25);
  color: #f1f5f9;
}

/* ── GRAIN TEXTURE OVERLAY ───────────────────────────────────────────────── */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ── PAGE TRANSITIONS ────────────────────────────────────────────────────── */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: #021a1e;
  z-index: 99998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.page-transition-overlay.active { opacity: 1; }

/* ── RESPONSIVE MOBILE FIXES ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .section, section {
    padding: 50px 20px;
  }
  .section-title, h2.section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
  .hero-cta {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  .btn-primary, .btn-outline {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
  .stat-item-v2 { padding: 0 12px; }
}

/* ── prefers-reduced-motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ambient-orb { animation: none !important; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
