/* ══════════════════════════════════════════════════════════════
   FMCSA — Faculty of Mathematical Sciences & Computer
   University of Gezira · Shared Design System
   Inspired by MIT, Stanford, Oxford, ETH Zurich
   ══════════════════════════════════════════════════════════════ */

/* ── IMPORTS ── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

/* ── DESIGN TOKENS ── */
:root {
  /* Brand Colors */
  --navy: #141345;
  --navy-light: #1a1860;
  --navy-dark: #0e0d30;
  --gold: #f5c518;
  --gold-light: #fad94a;
  --gold-dark: #c9a00e;
  --white: #ffffff;
  --off-white: #f8f9fc;
  --light-gray: #f0f1f5;
  --mid-gray: #e2e4ea;
  --text-gray: #6b7280;
  --dark-gray: #374151;
  --black: #1a1a1a;

  /* Accent Colors */
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;

  /* Semantic */
  --bg-primary: var(--white);
  --bg-secondary: var(--off-white);
  --bg-tertiary: var(--light-gray);
  --bg-dark: var(--navy);
  --bg-dark-alt: var(--navy-light);
  --text-primary: var(--navy);
  --text-secondary: var(--dark-gray);
  --text-muted: var(--text-gray);
  --text-on-dark: var(--white);
  --text-on-dark-muted: rgba(255, 255, 255, 0.6);
  --border-light: rgba(20, 19, 69, 0.08);
  --border-medium: rgba(20, 19, 69, 0.12);
  --border-dark: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-ar: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-en: 'Montserrat', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Layout */
  --max-width: 82.5rem;
  --nav-height: 8.5rem;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(20, 19, 69, 0.06);
  --shadow-md: 0 4px 12px rgba(20, 19, 69, 0.08);
  --shadow-lg: 0 12px 36px rgba(20, 19, 69, 0.12);
  --shadow-xl: 0 24px 64px rgba(20, 19, 69, 0.16);
  --shadow-glow: 0 0 40px rgba(245, 197, 24, 0.15);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 999px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  overflow-x: hidden;
}

body {
  font-family: var(--font-ar);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul,
ol {
  list-style: none;
}

/* ── UTILITY CLASSES ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  /* padding: 0 var(--space-xl); */
}

.section-padding {
  padding: var(--space-5xl) 0;
}

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

.text-right {
  text-align: right;
}

.font-en {
  font-family: var(--font-en);
  direction: ltr;
  text-align: right;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ══════════════════════════════════════════════════════════════
   NAVIGATION BAR
   ══════════════════════════════════════════════════════════════ */
:root {
  --nav-height: 100px;
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(248, 249, 252, 0.95);
  /* off‑white with slight transparency */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow 0.3s ease;
  border-bottom: 1px solid rgba(20, 19, 69, 0.06);
}

.site-nav.nav-scrolled {
  box-shadow: 0 4px 20px rgba(20, 19, 69, 0.08);
}

/* Remove the old transparent classes – we always use the off‑white style */
.site-nav.nav-transparent,
.site-nav.nav-solid {
  background: rgba(248, 249, 252, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── NON-INDEX PAGES: fully transparent when static ── */
.site-nav.nav-over-dark {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  transition: background 0.35s ease, border-color 0.35s ease,
    box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.site-nav.nav-over-dark .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

.site-nav.nav-over-dark .nav-link:hover,
.site-nav.nav-over-dark .nav-link.active {
  color: var(--gold);
}

.site-nav.nav-over-dark .nav-link::after {
  background: var(--gold);
}

.site-nav.nav-over-dark .nav-toggle {
  color: #fff;
}

/* Scrolled state → solid navy */
.site-nav.nav-over-dark.nav-scrolled {
  background: rgba(14, 13, 48, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* ── Mobile drawer dark theme (non-index pages) ── */
.nav-mobile.nav-mobile-dark {
  background: var(--navy-dark);
  border-left-color: rgba(255, 255, 255, 0.08);
}

.nav-mobile.nav-mobile-dark .nav-mobile-close {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-mobile.nav-mobile-dark .nav-mobile-link {
  color: rgba(255, 255, 255, 0.8);
}

.nav-mobile.nav-mobile-dark .nav-mobile-link:hover,
.nav-mobile.nav-mobile-dark .nav-mobile-link.active {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.06);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-brand img {
  height: 3.5rem;
  /* larger logo */
  width: auto;
  display: block;
}

/* Hide the text next to logo – index only shows the image */
.nav-brand-text {
  display: none;
}

/* Desktop Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  font-family: var(--font-ar);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-gray);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  transition: color 0.2s;
  position: relative;
  white-space: nowrap;
  background: transparent !important;
  /* override previous background styles */
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  right: 0.9rem;
  left: 0.9rem;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover,
.nav-link.active {
  color: var(--navy);
}

.nav-link.active::after,
.nav-link:hover::after {
  transform: scaleX(1);
}

/* CTA button in nav (if used) */
.nav-cta {
  font-family: var(--font-ar);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--gold);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-right: var(--space-sm);
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 197, 24, 0.35);
}

/* Mobile Toggle */
.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  border-radius: var(--radius-md);
  transition: background 0.15s;
}

.nav-toggle:hover {
  background: rgba(20, 19, 69, 0.05);
}

.nav-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Mobile Menu Overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s;
}

.nav-mobile-overlay.open {
  opacity: 1;
}

/* Mobile Drawer */
.nav-mobile {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  z-index: 1001;
  background: var(--white);
  padding: var(--space-xl);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  border-left: 1px solid var(--border-light);
}

[dir="ltr"] .nav-mobile {
  right: auto;
  left: 0;
  transform: translateX(-100%);
  border-left: none;
  border-right: 1px solid var(--border-light);
}

.nav-mobile.open {
  transform: translateX(0);
}

.nav-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
}

.nav-mobile-header .nav-brand img {
  height: 2.5rem;
}

.nav-mobile-close {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  border-radius: var(--radius-md);
  background: rgba(20, 19, 69, 0.04);
}

.nav-mobile-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nav-mobile-link {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}

.nav-mobile-link:hover,
.nav-mobile-link.active {
  color: var(--navy);
  background: rgba(20, 19, 69, 0.04);
}

.nav-mobile-link.active {
  color: var(--gold-dark);
}

/* ══════════════════════════════════════════════════════════════
   FOOTER — matched to index.html style
   ══════════════════════════════════════════════════════════════ */
.site-footer {
  direction: ltr;
  background: var(--navy);
  padding: var(--space-xl) 0;
}

.footer-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-logo img {
  height: 7rem;
  width: auto;
  opacity: 1;
}

.footer-logo p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.5rem;
}

.footer-middle {
  display: none;
  /* index footer does not use a separate middle text */
}

.footer-copy {
  display: none;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.footer-follow {
  display: none;
  /* "تابعنا" not shown in index footer */
}

.footer-social {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-social-link {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s;
}

.footer-social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.footer-social-link svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.footer-top-btn {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s;
  border: none;
  cursor: pointer;
}

.footer-top-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.footer-top-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  stroke: currentColor;
  stroke-width: 2;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-mobile,
  .nav-mobile-overlay {
    display: block;
  }

  .site-nav .nav-inner {
    position: relative;
    justify-content: center;
    /* fallback */
  }

  .site-nav .nav-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .site-nav .nav-toggle {
    position: absolute;
    right: var(--space-xl);
    margin-right: 0;
  }

  /* Adjust padding to prevent overlap */
  @media (max-width: 600px) {
    .site-nav .nav-toggle {
      right: var(--space-md);
    }
  }
}

@media (max-width: 700px) {
  .footer-simple {
    flex-direction: column;
    text-align: center;
  }

  .footer-top-btn {
    display: none;
    /* index hides top button on mobile */
  }

  .footer-logo img {
    height: 2.5rem;
    /* smaller logo on mobile */
  }

  .footer-social {
    order: 2;
  }

  .footer-logo {
    order: 1;
  }
}

@media (max-width: 600px) {
  :root {
    --nav-height: 3.75rem;
    /* smaller nav on mobile as in index */
  }

  .nav-inner {
    padding: 0 var(--space-md);
  }

  .nav-brand img {
    height: 2.5rem;
  }
}

@media (max-width: 480px) {
  .nav-brand-text {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   SHARED COMPONENTS
   ══════════════════════════════════════════════════════════════ */

/* Section Headers */
.section-header {
  margin-bottom: var(--space-3xl);
}

/* Page hero — sits behind the transparent nav.
   No body padding-top; hero extends under the fixed nav.
   Content uses padding-top to clear the nav area. */
.page-hero {
  position: relative;
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 3rem;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}

.page-hero .page-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  mix-blend-mode: luminosity;
}

.page-hero .page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 19, 69, 0.4) 0%, rgba(14, 13, 48, 0.85) 100%);
}

.page-hero .container {
  position: relative;
  z-index: 2;
}

.section-eyebrow {
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900;
  line-height: 1.3;
  color: var(--text-primary);
}

.section-title.on-dark {
  color: var(--white);
}

.section-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: var(--space-md);
  max-width: 40rem;
}

.section-subtitle.on-dark {
  color: var(--text-on-dark-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-ar);
  font-weight: 700;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(245, 197, 24, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(245, 197, 24, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  padding: 0.85rem 2rem;
  font-size: 0.95rem;
  border: 2px solid var(--border-medium);
}

.btn-secondary:hover {
  border-color: var(--navy);
  background: rgba(20, 19, 69, 0.04);
}

.btn-secondary.on-dark {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary.on-dark:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.btn-sm {
  padding: 0.55rem 1.4rem;
  font-size: 0.82rem;
}

.btn svg {
  width: 1rem;
  height: 1rem;
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

/* Tags / Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(245, 197, 24, 0.1);
  color: var(--gold-dark);
  border: 1px solid rgba(245, 197, 24, 0.2);
}

.badge.on-dark {
  background: rgba(245, 197, 24, 0.12);
  color: var(--gold);
  border-color: rgba(245, 197, 24, 0.2);
}

/* Divider */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
}

.divider.on-dark {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* ══════════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATION
   ══════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

.reveal-delay-4 {
  transition-delay: 0.4s;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — NAVIGATION
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-mobile,
  .nav-mobile-overlay {
    display: block;
  }

}

@media (max-width: 600px) {
  :root {
    --nav-height: 3.75rem;
  }

  .container {
    padding: 0 var(--space-lg);
  }

  .section-padding {
    padding: var(--space-3xl) 0;
  }

  .footer-simple {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .footer-right {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-inner {
    padding: 0 var(--space-md);
  }

  .nav-brand img {
    height: 2rem;
  }

  .nav-brand-title {
    font-size: 0.78rem;
  }

  .nav-brand-subtitle {
    display: none;
  }
}

@media (max-width: 480px) {
  .nav-brand-text {
    display: none;
  }

}

@media (max-width: 380px) {
  .container {
    padding: 0 var(--space-md);
  }

  .nav-brand img {
    height: 1.85rem;
  }
}

/* ── PRINT ── */
@media print {

  .site-nav,
  .nav-mobile,
  .nav-mobile-overlay {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
  }
}