/**
 * Global stylesheet.
 * ---------------------------------------------------------------------------
 */

/* ---- Web font: Tajawal (self-hosted) ------------------------------------- */
@font-face {
  font-family: "Tajawal";
  src: url("/fonts/ArbFONTS-Tajawal-Regular.ttf") format("truetype");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TajawalCustom';
  src: url('/fonts/ArbFONTS-Tajawal-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

.tajawal-title {
  font-family: 'TajawalCustom', sans-serif;
  font-weight: 700;
}

/* ---- Design tokens ------------------------------------------------------- */
:root {
  --color-brand: #0d9488;
  --color-brand-dark: #0f766e;
  --color-accent: #6f00ff;       /* اللون البنفسجي */
  --color-accent-dark: #5a2fd6;
  --color-surface: rgba(255, 255, 255, 0.88);
  --color-background: #f8fafc;
  --color-foreground: #000000;   /* اللون الأسود لأسماء الصفحات */
  --color-muted: #64748b;
  --navbar-height: 5.5rem;
  
  --nav-margin: 18px;
}

body {
  font-family: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
}

*, *::before, *::after {
  -webkit-tap-highlight-color: transparent !important;
}

/* ---- Global base ---------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height);
}

body {
  background-color: var(--color-background);
  color: var(--color-foreground);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---- Scroll-reveal animation --------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================================================================
 * NAVBAR
 * ===========================================================================
 */
.navbar-shell {
  position: fixed;
  top: var(--nav-margin);
  left: var(--nav-margin);
  right: var(--nav-margin);
  z-index: 100;
  margin-inline: auto;
  max-width: 1240px;
  width: calc(100% - (2 * var(--nav-margin)));
  
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  will-change: transform, opacity;
}

.navbar-shell.navbar-hidden {
  transform: translateY(calc(-100% - var(--nav-margin) - 20px));
  opacity: 0;
  pointer-events: none;
}

.navbar-container {
  width: 100%;
  min-height: 64px;
  background-color: var(--color-surface);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 
    0 6px 20px 0 rgba(0, 0, 0, 0.04),
    0 1px 3px 0 rgba(0, 0, 0, 0.02),
    inset 0 1px 1px 0 rgba(255, 255, 255, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px clamp(12px, 2vw, 24px);
}

.navbar-logo-container {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-start;
}

.navbar-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  outline: none !important;
  border: none !important;
  background: transparent !important;
}

.navbar-logo {
  height: clamp(26px, 3vw, 40px);
  width: auto;
  object-fit: contain;
  display: block;
}

/* ---- Navigation Links List (Desktop) ------------------------------------- */
.navbar-nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 1.8vw, 1.8rem);
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 2;
}

.nav-link {
  position: relative;
  font-size: clamp(12px, 0.45rem + 0.65vw, 16px);
  font-weight: 600;
  color: #000000 !important;
  text-decoration: none;
  padding: 6px 2px;
  display: inline-block;
  opacity: 1 !important;
  visibility: visible !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.nav-link:hover {
  color: #000000 !important;
}

.nav-link::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2.5px;
  width: 0;
  border-radius: 2px;
  margin-inline: auto;
  background-color: var(--color-accent);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link.is-active {
  color: var(--color-accent) !important;
}

.nav-link.is-active::after {
  width: 85%;
}

/* ---- Download button container ------------------------------------------- */
.navbar-btn-container {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
}

.navbar-btn-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 0.8vw, 10px) clamp(10px, 1.4vw, 20px);
  border-radius: 6px;
  background-color: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
  font-size: clamp(11px, 0.45rem + 0.6vw, 14.5px);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  outline: none !important;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease, transform 0.15s ease;
}

.btn-download:hover,
.btn-download:focus-visible {
  background-color: var(--color-accent-dark);
  outline: none !important;
  box-shadow: none;
}

.btn-download:active {
  transform: scale(0.97);
}

/* ---- "قريبًا" Tooltip ---------------------------------------------------- */
.download-note {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%) translateY(4px);
  margin-top: 5px;
  font-size: clamp(9px, 0.4rem + 0.4vw, 11.5px);
  font-weight: 700;
  color: var(--color-accent);
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid rgba(111, 0, 255, 0.15);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 110;
}

.download-note.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===========================================================================
 * RESPONSIVE MEDIA QUERIES
 * ===========================================================================
 */

/* Medium Desktop & Tablet Landscape */
@media (max-width: 1024px) {
  .navbar-container {
    min-height: 58px;
    border-radius: 8px;
  }
}

/* Mobile & Tablets (<= 768px)
 * - النافبار ثابتة بأعلى الصفحة
 * - إخفاء أسماء الصفحات للموبايل فقط
 */
@media (max-width: 768px) {
  :root {
    --nav-margin: 14px;
  }

  .navbar-shell {
    position: absolute !important;
    top: var(--nav-margin) !important;
    transform: none !important;
    opacity: 1 !important;
  }

  .navbar-container {
    min-height: 52px;
    padding: 6px 14px;
    border-radius: 7px;
  }

  /* إخفاء أسماء الصفحات في الموبايل */
  .navbar-nav-list {
    display: none !important;
  }

  .navbar-logo {
    height: 30px;
  }

  .btn-download {
    padding: 7px 14px;
    font-size: 13px;
  }
}

/* Small Smart Phones (<= 430px) */
@media (max-width: 430px) {
  :root {
    --nav-margin: 10px;
  }

  .navbar-container {
    min-height: 48px;
    padding: 5px 12px;
    border-radius: 6px;
  }

  .navbar-logo {
    height: 26px;
  }

  .btn-download {
    padding: 6px 12px;
    font-size: 12px;
  }
}