/* ====================================================
   Ontime-Links v2 — Premium CSS
   Dark / Light modes + RTL / LTR + Cinematic BG
   ==================================================== */

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

/* ── Design Tokens ─────────────────────────────────── */
:root {
  --font-ar: 'Cairo', sans-serif;
  --font-en: 'Inter', sans-serif;
  --r-card: 18px;
  --r-icon: 14px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);

  /* Dark palette — Solid & Premium */
  --bg:           #060813;
  --surface:      #0f172a;
  --surface-h:    #1e293b;
  --border:       #1e293b;
  --border-h:     rgba(59, 130, 246, 0.5);
  --ink-1:        #ffffff;
  --ink-2:        #94a3b8;
  --ink-3:        #64748b;
  --ctrl-bg:      #0f172a;
  --ctrl-border:  #1e293b;
  --ctrl-h:       #1e293b;
  --logo-bg:      transparent;
  --orb-a:        rgba(59,130,246,0.18);
  --orb-b:        rgba(99,102,241,0.12);
  --orb-c:        rgba(14,165,233,0.10);
  --grid:         rgba(255,255,255,0.02);
  --divider:      rgba(255,255,255,0.08);
  --plane-color:  rgba(255,255,255,0.22);
  --shine:        rgba(255,255,255,0.06);
  --tag-bg:       #0f172a;
  --tag-border:   #1e293b;
  --card-shadow:  0 4px 18px -2px rgba(0, 0, 0, 0.45), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --card-shadow-h: 0 14px 30px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(59, 130, 246, 0.35);
  --chevron-bg:   #1e293b;
  --chevron-color: #94a3b8;
}

/* ── Light Tokens ──────────────────────────────────── */
[data-theme="light"] {
  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --surface-h:    #f8fafc;
  --border:       #e2e8f0;
  --border-h:     rgba(37, 99, 235, 0.4);
  --ink-1:        #0f172a;
  --ink-2:        #475569;
  --ink-3:        #94a3b8;
  --ctrl-bg:      #ffffff;
  --ctrl-border:  #e2e8f0;
  --ctrl-h:       #f1f5f9;
  --logo-bg:      transparent;
  --orb-a:        rgba(59,130,246,0.10);
  --orb-b:        rgba(99,102,241,0.07);
  --orb-c:        rgba(14,165,233,0.05);
  --grid:         rgba(30,60,150,0.03);
  --divider:      rgba(30,60,150,0.08);
  --plane-color:  rgba(59,130,246,0.18);
  --shine:        rgba(255,255,255,0.4);
  --tag-bg:       #ffffff;
  --tag-border:   #e2e8f0;
  --card-shadow:  none;
  --card-shadow-h: none;
  --chevron-bg:   #f1f5f9;
  --chevron-color: #64748b;
}

/* ── Base ──────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink-1);
  font-family: var(--font-ar);
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.45s var(--ease), color 0.3s ease;
}

body.lang-en { font-family: var(--font-en); direction: ltr; }

/* ══════════════════════════════════════════════════════
   CINEMATIC BACKGROUND
══════════════════════════════════════════════════════ */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
  transition: background 0.45s var(--ease);
}

/* Two layered images cross-fading (Ken Burns effect) */
.bg-image {
  position: absolute;
  inset: -6%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  will-change: transform, opacity;
}

.bg-image {
  --bg-img-op: 0.85;
}
[data-theme="light"] .bg-image {
  --bg-img-op: 0.80;
}

.bg-img-1 {
  background-image: url('https://images.unsplash.com/photo-1464037866556-6812c9d1c72e?q=80&w=2070&auto=format&fit=crop');
  opacity: var(--bg-img-op);
  animation: kenBurns1 30s ease-in-out infinite;
}

.bg-img-2 {
  background-image: url('https://images.unsplash.com/photo-1540959733332-eab4deabeeaf?q=80&w=2070&auto=format&fit=crop');
  opacity: 0;
  animation: kenBurns2 30s ease-in-out infinite;
}

@keyframes kenBurns1 {
  0%   { transform: scale(1.08) translateX(0);     opacity: var(--bg-img-op); }
  40%  { opacity: var(--bg-img-op); }
  50%  { transform: scale(1.00) translateX(-1.5%); opacity: 0; }
  100% { transform: scale(1.08) translateX(0);     opacity: 0; }
}
@keyframes kenBurns2 {
  0%   { opacity: 0; }
  45%  { opacity: 0; }
  50%  { transform: scale(1.05) translateX(1.5%);  opacity: var(--bg-img-op); }
  90%  { opacity: var(--bg-img-op); }
  100% { transform: scale(1.10) translateX(0);     opacity: 0; }
}

/* Gradient overlays */
.bg-overlay-top {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 35%);
  pointer-events: none;
}
.bg-overlay-bottom {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 40%);
  pointer-events: none;
}
.bg-overlay-center {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, var(--bg) 100%);
  pointer-events: none;
  opacity: 0.25;
}

/* Light mode: NO shadow, vignette, or dark overlays on the background */
[data-theme="light"] .bg-overlay-top,
[data-theme="light"] .bg-overlay-bottom,
[data-theme="light"] .bg-overlay-center {
  display: none !important;
}

[data-theme="light"] .grid-overlay,
[data-theme="light"] .orb {
  display: none !important;
}

[data-theme="light"] .bg-image {
  --bg-img-op: 1;
}

/* Light mode: NO shadow cast by elements onto the background */
[data-theme="light"] .ctrl-btn,
[data-theme="light"] .ctrl-btn:hover,
[data-theme="light"] .stat-pill,
[data-theme="light"] .stat-pill:hover,
[data-theme="light"] .link-card,
[data-theme="light"] .link-card:hover,
[data-theme="light"] .card-website,
[data-theme="light"] .card-website:hover {
  box-shadow: none !important;
}

[data-theme="light"] .logo {
  filter: none !important;
}

[data-theme="light"] .logo-glow {
  display: none !important;
}

/* Grid */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 55px 55px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 75%);
  pointer-events: none;
  transition: background-image 0.4s ease;
}

/* Orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  animation: orbDrift linear infinite;
}
.orb-1 { width:480px; height:480px; background:radial-gradient(circle, var(--orb-a) 0%, transparent 70%); top:-120px; right:-80px; animation-duration:22s; animation-delay:0s; }
.orb-2 { width:360px; height:360px; background:radial-gradient(circle, var(--orb-b) 0%, transparent 70%); bottom:-80px; left:-60px; animation-duration:27s; animation-delay:-10s; }
.orb-3 { width:280px; height:280px; background:radial-gradient(circle, var(--orb-c) 0%, transparent 70%); top:45%; left:48%; transform:translate(-50%,-50%); animation-duration:18s; animation-delay:-5s; }

@keyframes orbDrift {
  0%,100% { transform: translate(0,0) scale(1); }
  25%  { transform: translate(25px,-25px) scale(1.06); }
  50%  { transform: translate(-18px,18px) scale(0.94); }
  75%  { transform: translate(12px,10px) scale(1.03); }
}

/* ══════════════════════════════════════════════════════
   ANIMATED PLANES
══════════════════════════════════════════════════════ */
.planes-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.plane {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0;
}

.plane svg {
  filter: drop-shadow(0 0 6px rgba(59,130,246,0.4));
}

/* Plane trail */
.plane-trail {
  width: 80px;
  height: 2px;
  background: linear-gradient(to left, rgba(255,255,255,0.5), transparent);
  border-radius: 99px;
  margin-right: -4px;
  order: -1;
}

[data-theme="light"] .plane-trail {
  background: linear-gradient(to left, rgba(59,130,246,0.4), transparent);
}

/* Plane 1 — large, crosses top */
.plane-1 {
  width: 44px;
  top: 18%;
  left: -60px;
  animation: flyAcross1 18s linear infinite;
  animation-delay: 0s;
}
.plane-1 svg { opacity: 0.35; width: 44px; height: 44px; }
.plane-1 .plane-trail { width: 100px; }

/* Plane 2 — medium, crosses middle-upper */
.plane-2 {
  width: 32px;
  top: 38%;
  left: -50px;
  animation: flyAcross2 25s linear infinite;
  animation-delay: -9s;
}
.plane-2 svg { opacity: 0.22; width: 32px; height: 32px; }

/* Plane 3 — small, crosses lower */
.plane-3 {
  width: 20px;
  top: 60%;
  left: -40px;
  animation: flyAcross3 32s linear infinite;
  animation-delay: -14s;
}
.plane-3 svg { opacity: 0.15; width: 20px; height: 20px; }

@keyframes flyAcross1 {
  0%   { transform: translate(-80px, 0) rotate(-8deg);  opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { transform: translate(110vw, -5vh) rotate(-8deg); opacity: 0; }
}
@keyframes flyAcross2 {
  0%   { transform: translate(-60px, 0) rotate(-5deg);  opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { transform: translate(110vw, -3vh) rotate(-5deg); opacity: 0; }
}
@keyframes flyAcross3 {
  0%   { transform: translate(-40px, 0) rotate(-3deg);  opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { transform: translate(110vw, 2vh) rotate(-3deg); opacity: 0; }
}

/* ══════════════════════════════════════════════════════
   TOP CONTROLS
══════════════════════════════════════════════════════ */
.top-controls {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 7px;
}
body.lang-en .top-controls { left: auto; right: 18px; }

.ctrl-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--ctrl-bg);
  border: 1px solid var(--ctrl-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  border-radius: 50px;
  color: var(--ink-2);
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s var(--spring), box-shadow 0.25s ease;
}
.ctrl-btn:hover {
  background: var(--ctrl-h);
  border-color: var(--border-h);
  color: var(--ink-1);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}
.ctrl-btn svg { flex-shrink: 0; }

.theme-toggle { padding: 9px 11px; }
.lang-toggle  { padding: 9px 15px; }

/* Theme icons */
.icon-sun  { display: none; width: 16px; height: 16px; }
.icon-moon { display: block; width: 16px; height: 16px; }
[data-theme="light"] .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: none;  }

/* ══════════════════════════════════════════════════════
   CONTAINER
══════════════════════════════════════════════════════ */
.container {
  position: relative;
  z-index: 10;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 64px 20px 44px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ══════════════════════════════════════════════════════
   PROFILE HEADER
══════════════════════════════════════════════════════ */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding-top: 28px;
}

/* Logo */
.logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse {
  0%,100% { opacity: 0.5; transform: scale(1);    }
  50%      { opacity: 1;   transform: scale(1.08); }
}

.logo {
  max-width: 220px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.3));
  position: relative;
  z-index: 1;
}

/* Logo variants */
.logo-dark  { display: block; }
.logo-light { display: none;  }
[data-theme="light"] .logo-dark  { display: none;  }
[data-theme="light"] .logo-light { display: block; }

/* Tagline */
.tagline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  transition: color 0.3s ease;
}
.tagline-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3b82f6;
  opacity: 0.7;
  animation: dotPulse 2s ease-in-out infinite;
}
.tagline-dot:last-child { animation-delay: 1s; }
@keyframes dotPulse {
  0%,100% { transform: scale(1); opacity: 0.7; }
  50%      { transform: scale(1.4); opacity: 1; }
}

/* Stats row */
.stats-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.stat-pill:hover {
  border-color: var(--border-h);
  color: var(--ink-1);
}
.stat-pill svg { width: 13px; height: 13px; opacity: 0.85; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   LINK CARDS
══════════════════════════════════════════════════════ */
.links-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: var(--ink-1);
  overflow: hidden;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s var(--spring),
    box-shadow 0.25s ease,
    color 0.25s ease;
  will-change: transform;
}

.link-card:hover {
  background: var(--surface-h);
  border-color: var(--border-h);
  transform: translateY(-3px) scale(1.006);
  box-shadow: var(--card-shadow-h);
}

.link-card:active {
  transform: scale(0.985);
}

/* Shine */
.card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--shine) 0%, transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.link-card:hover .card-shine { opacity: 1; }

/* Icon */
.card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--r-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0;
  flex-shrink: 0;
  transition: transform 0.35s var(--spring), box-shadow 0.35s ease;
}
.card-icon svg { width: 22px; height: 22px; }
.link-card:hover .card-icon { transform: scale(1.1) rotate(-3deg); }

/* Text */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.card-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-1);
  transition: color 0.25s ease;
  white-space: nowrap;
}
.card-sub {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}

/* Chevron */
.card-chevron {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--chevron-bg);
  color: var(--chevron-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s var(--spring);
}
.card-chevron svg { width: 14px; height: 14px; transform: rotate(180deg); } /* RTL → points right */
body.lang-en .card-chevron svg { transform: rotate(0deg); }

.link-card:hover .card-chevron {
  background: #2563eb;
  color: #ffffff;
  transform: translateX(-3px);
}
body.lang-en .link-card:hover .card-chevron {
  transform: translateX(3px);
}

/* ── Icon Colors ──────────────────────────────────── */
.icon-website  { background: linear-gradient(135deg,#1d4ed8,#3b82f6); box-shadow: 0 4px 14px rgba(59,130,246,0.35); }
.icon-whatsapp { background: linear-gradient(135deg,#075e54,#25d366); box-shadow: 0 4px 14px rgba(37,211,102,0.32); }
.icon-facebook { background: linear-gradient(135deg,#1877f2,#42a5f5); box-shadow: 0 4px 14px rgba(24,119,242,0.30); }
.icon-instagram{ background: linear-gradient(135deg,#7c3aed,#db2777,#f97316); box-shadow: 0 4px 14px rgba(219,39,119,0.30); }
.icon-tiktok   { background: linear-gradient(135deg,#0f0f1a,#1a1a2e); border:1px solid rgba(254,44,85,0.4); box-shadow: 0 4px 14px rgba(254,44,85,0.20); }
.icon-linkedin { background: linear-gradient(135deg,#0369a1,#0ea5e9); box-shadow: 0 4px 14px rgba(10,102,194,0.30); }
.icon-email    { background: linear-gradient(135deg,#0891b2,#38bdf8); box-shadow: 0 4px 14px rgba(14,165,233,0.30); }

/* ── Hover accent borders ─────────────────────────── */
.card-website:hover  { border-color: rgba(59,130,246,0.6); }
.card-whatsapp:hover { border-color: rgba(37,211,102,0.6); }
.card-facebook:hover { border-color: rgba(24,119,242,0.6); }
.card-instagram:hover{ border-color: rgba(219,39,119,0.6); }
.card-tiktok:hover   { border-color: rgba(254,44,85,0.6);  }
.card-linkedin:hover { border-color: rgba(10,102,194,0.6); }
.card-email:hover    { border-color: rgba(14,165,233,0.6); }

/* ── Website card accent ────────────────────────── */
.card-website {
  background: linear-gradient(135deg, #131f38 0%, #0f172a 100%);
  border: 1.5px solid rgba(59, 130, 246, 0.4);
}
.card-website:hover {
  background: linear-gradient(135deg, #172646 0%, #111d33 100%);
  border-color: #3b82f6;
  box-shadow: 0 16px 36px -4px rgba(37, 99, 235, 0.35), 0 0 0 1px #3b82f6;
}
[data-theme="light"] .card-website {
  background: #ffffff;
  border: 1.5px solid rgba(37, 99, 235, 0.4);
}
[data-theme="light"] .card-website:hover {
  background: #f8faff;
  border-color: #2563eb;
  box-shadow: none;
}

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
.page-footer {
  text-align: center;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.footer-line {
  width: 52px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--divider), transparent);
  margin-bottom: 6px;
  transition: background 0.3s ease;
}
.footer-copy {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 400;
  transition: color 0.3s ease;
}
.footer-brand {
  font-size: 10px;
  color: var(--ink-3);
  opacity: 0.45;
  font-family: var(--font-en);
  letter-spacing: 0.10em;
  font-weight: 600;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════
   ENTRANCE ANIMATIONS
══════════════════════════════════════════════════════ */
/* JS-driven transitions — starts visible, animates on scroll */
[data-animate] {
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
[data-animate].hidden {
  opacity: 0;
  transform: translateY(22px);
}
[data-animate="fade-down"].hidden { transform: translateY(-12px); }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 520px) {
  .container { padding: 52px 14px 36px; }
  .logo { max-width: 180px; }
  .link-card { padding: 14px 15px; gap: 12px; }
  .card-icon { width: 42px; height: 42px; min-width: 42px; }
  .card-icon svg { width: 20px; height: 20px; }
}

@media (max-width: 360px) {
  .stats-row { gap: 5px; }
  .stat-pill { padding: 4px 10px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
