/* ================================================
   Ontime-Links — Premium Link Page CSS
   Supports: Dark / Light mode + RTL / LTR
   ================================================ */

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

/* ── CSS Custom Properties (Dark default) ────── */
:root {
  /* Layout */
  --font-ar: 'Cairo', sans-serif;
  --font-en: 'Inter', sans-serif;
  --radius: 20px;
  --radius-sm: 14px;
  --transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Dark theme tokens */
  --bg-deep:       #03040a;
  --bg-scene:      #03040a;
  --bg-card:       rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border:        rgba(255, 255, 255, 0.08);
  --border-hover:  rgba(255, 255, 255, 0.18);
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --logo-bg:       rgba(255,255,255,0.05);
  --logo-border:   rgba(255,255,255,0.12);
  --stat-bg:       rgba(255,255,255,0.05);
  --stat-border:   rgba(255,255,255,0.08);
  --control-bg:    rgba(255,255,255,0.06);
  --control-border:rgba(255,255,255,0.1);
  --control-hover: rgba(255,255,255,0.1);
  --orb-1: rgba(59,130,246,0.18);
  --orb-2: rgba(99,102,241,0.12);
  --orb-3: rgba(14,165,233,0.10);
  --grid-color: rgba(255,255,255,0.02);
  --footer-divider: rgba(255,255,255,0.06);

  /* Blue accent (same both modes) */
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-glow: rgba(59,130,246,0.35);
}

/* ── Light Mode ──────────────────────────────── */
[data-theme="light"] {
  --bg-deep:       #f0f4ff;
  --bg-scene:      #e8effe;
  --bg-card:       rgba(255,255,255,0.72);
  --bg-card-hover: rgba(255,255,255,0.92);
  --border:        rgba(30,60,150,0.10);
  --border-hover:  rgba(30,60,150,0.22);
  --text-primary:  #0f172a;
  --text-secondary:#334155;
  --text-muted:    #64748b;
  --logo-bg:       rgba(255,255,255,0.9);
  --logo-border:   rgba(59,130,246,0.2);
  --stat-bg:       rgba(255,255,255,0.7);
  --stat-border:   rgba(59,130,246,0.12);
  --control-bg:    rgba(255,255,255,0.8);
  --control-border:rgba(59,130,246,0.15);
  --control-hover: rgba(255,255,255,1);
  --orb-1: rgba(59,130,246,0.14);
  --orb-2: rgba(99,102,241,0.10);
  --orb-3: rgba(14,165,233,0.08);
  --grid-color: rgba(30,60,150,0.04);
  --footer-divider: rgba(30,60,150,0.08);
}

html {
  scroll-behavior: smooth;
}

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

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

/* ── Animated Background ─────────────────────── */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg-scene);
  transition: background 0.4s ease;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 12s ease-in-out infinite;
  transition: background 0.4s ease;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--orb-1) 0%, transparent 70%);
  top: -150px;
  right: -100px;
  animation-delay: 0s;
  animation-duration: 15s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--orb-2) 0%, transparent 70%);
  bottom: -100px;
  left: -80px;
  animation-delay: -5s;
  animation-duration: 18s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--orb-3) 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: -8s;
  animation-duration: 20s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  transition: background-image 0.4s ease;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ── Top Controls Bar ────────────────────────── */
.top-controls {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.lang-en .top-controls {
  left: auto;
  right: 20px;
}

/* Shared pill style for both toggles */
.lang-toggle,
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--control-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--control-border);
  border-radius: 50px;
  color: var(--text-secondary);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.lang-toggle {
  padding: 8px 16px;
}

.theme-toggle {
  padding: 8px 12px;
  width: 42px;
  justify-content: center;
}

.lang-toggle:hover,
.theme-toggle:hover {
  background: var(--control-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Theme icon visibility */
.theme-icon-dark,
.theme-icon-light {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Dark mode: show moon, hide sun */
.theme-icon-light { display: none; }
.theme-icon-dark  { display: flex; }

/* Light mode: show sun, hide moon */
[data-theme="light"] .theme-icon-light { display: flex; }
[data-theme="light"] .theme-icon-dark  { display: none; }

.lang-icon {
  font-size: 15px;
  line-height: 1;
}

/* ── Main Container ──────────────────────────── */
.container {
  position: relative;
  z-index: 10;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 60px 20px 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── Profile Header ──────────────────────────── */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding-top: 20px;
}

.logo-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
}

.logo-glow {
  position: absolute;
  inset: -12px;
  background: radial-gradient(circle, var(--blue-glow) 0%, transparent 70%);
  border-radius: 50%;
  animation: logoGlowPulse 3s ease-in-out infinite;
}

@keyframes logoGlowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

.logo-img {
  width: 110px;
  height: 110px;
  border-radius: 28px;
  object-fit: contain;
  background: var(--logo-bg);
  border: 1px solid var(--logo-border);
  padding: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2), 0 0 0 1px rgba(59,130,246,0.2);
  position: relative;
  z-index: 1;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.online-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  width: 18px;
  height: 18px;
  background: #22c55e;
  border-radius: 50%;
  border: 3px solid var(--bg-deep);
  z-index: 2;
  animation: badgePulse 2.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.4);
  transition: border-color 0.4s ease;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-size: clamp(26px, 6vw, 34px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: none; /* gradient handles theme */
}

.brand-tagline {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.3s ease;
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--stat-bg);
  border: 1px solid var(--stat-border);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.stat-icon {
  font-size: 13px;
  line-height: 1;
}

/* ── Links Section ───────────────────────────── */
.links-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Link Cards ──────────────────────────────── */
.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition:
    background 0.35s cubic-bezier(0.34,1.56,0.64,1),
    border-color 0.35s ease,
    transform 0.35s cubic-bezier(0.34,1.56,0.64,1),
    box-shadow 0.35s ease,
    color 0.3s ease;
  will-change: transform;
}

.link-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

[data-theme="light"] .link-card:hover {
  box-shadow: 0 16px 40px rgba(59,130,246,0.12);
}

.link-card:active {
  transform: translateY(0) scale(0.99);
}

/* Shine overlay */
.card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

[data-theme="light"] .card-shine {
  background: linear-gradient(135deg, rgba(255,255,255,0.5) 0%, transparent 60%);
}

.link-card:hover .card-shine {
  opacity: 1;
}

/* Icon wrap */
.card-icon-wrap {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.card-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.link-card:hover .card-icon-wrap {
  transform: scale(1.15) rotate(-3deg);
}

/* Text block */
.card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card-label {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.card-sublabel {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

/* Arrow */
.card-arrow {
  width: 22px;
  height: 22px;
  min-width: 22px;
  color: var(--text-muted);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-arrow svg {
  width: 18px;
  height: 18px;
  transform: rotate(180deg); /* RTL: points → */
}

body.lang-en .card-arrow svg {
  transform: rotate(0deg);
}

.link-card:hover .card-arrow {
  color: var(--text-primary);
  transform: translateX(-3px);
}

body.lang-en .link-card:hover .card-arrow {
  transform: translateX(3px);
}

/* ── Card Color Themes (adapts light/dark) ───── */

/* Primary — Website */
.primary-card {
  background: linear-gradient(135deg, rgba(37,99,235,0.15) 0%, rgba(59,130,246,0.07) 100%);
  border-color: rgba(59,130,246,0.28);
}
[data-theme="light"] .primary-card {
  background: linear-gradient(135deg, rgba(37,99,235,0.06) 0%, rgba(59,130,246,0.03) 100%);
  border-color: rgba(59,130,246,0.25);
}
.primary-card:hover {
  background: linear-gradient(135deg, rgba(37,99,235,0.25) 0%, rgba(59,130,246,0.12) 100%);
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 20px 50px rgba(59,130,246,0.18);
}
[data-theme="light"] .primary-card:hover {
  background: linear-gradient(135deg, rgba(37,99,235,0.1) 0%, rgba(59,130,246,0.06) 100%);
  box-shadow: 0 16px 40px rgba(59,130,246,0.18);
}
.primary-icon {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  box-shadow: 0 8px 20px rgba(59,130,246,0.35);
}

/* WhatsApp */
.whatsapp-card:hover { border-color: rgba(37,211,102,0.35); box-shadow: 0 20px 50px rgba(37,211,102,0.12); }
[data-theme="light"] .whatsapp-card:hover { box-shadow: 0 16px 40px rgba(37,211,102,0.15); }
.whatsapp-icon { background: linear-gradient(135deg, #128c7e, #25d366); color: white; box-shadow: 0 8px 20px rgba(37,211,102,0.3); }

/* Facebook */
.facebook-card:hover { border-color: rgba(24,119,242,0.35); box-shadow: 0 20px 50px rgba(24,119,242,0.12); }
[data-theme="light"] .facebook-card:hover { box-shadow: 0 16px 40px rgba(24,119,242,0.15); }
.facebook-icon { background: linear-gradient(135deg, #0866ff, #1877f2); color: white; box-shadow: 0 8px 20px rgba(24,119,242,0.3); }

/* Instagram */
.instagram-card:hover { border-color: rgba(225,48,108,0.35); box-shadow: 0 20px 50px rgba(225,48,108,0.12); }
[data-theme="light"] .instagram-card:hover { box-shadow: 0 16px 40px rgba(225,48,108,0.15); }
.instagram-icon { background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045); color: white; box-shadow: 0 8px 20px rgba(225,48,108,0.3); }

/* TikTok */
.tiktok-card:hover { border-color: rgba(254,44,85,0.35); box-shadow: 0 20px 50px rgba(254,44,85,0.12); }
[data-theme="light"] .tiktok-card:hover { box-shadow: 0 16px 40px rgba(254,44,85,0.15); }
.tiktok-icon {
  background: linear-gradient(135deg, #010101, #161722);
  color: white;
  box-shadow: 0 8px 20px rgba(254,44,85,0.25);
  border: 1px solid rgba(254,44,85,0.3);
}
[data-theme="light"] .tiktok-icon {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

/* LinkedIn */
.linkedin-card:hover { border-color: rgba(10,102,194,0.35); box-shadow: 0 20px 50px rgba(10,102,194,0.12); }
[data-theme="light"] .linkedin-card:hover { box-shadow: 0 16px 40px rgba(10,102,194,0.15); }
.linkedin-icon { background: linear-gradient(135deg, #0077b5, #0a66c2); color: white; box-shadow: 0 8px 20px rgba(10,102,194,0.3); }

/* Email */
.email-card:hover { border-color: rgba(14,165,233,0.35); box-shadow: 0 20px 50px rgba(14,165,233,0.12); }
[data-theme="light"] .email-card:hover { box-shadow: 0 16px 40px rgba(14,165,233,0.15); }
.email-icon { background: linear-gradient(135deg, #0ea5e9, #38bdf8); color: white; box-shadow: 0 8px 20px rgba(14,165,233,0.3); }

/* ── Footer ──────────────────────────────────── */
.page-footer {
  text-align: center;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--footer-divider), transparent);
  margin-bottom: 8px;
  transition: background 0.3s ease;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  transition: color 0.3s ease;
}

.footer-brand {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  font-family: var(--font-en);
  letter-spacing: 0.08em;
  font-weight: 500;
  transition: color 0.3s ease;
}

/* ── Entrance Animations ─────────────────────── */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22,1,0.36,1);
}

[data-animate="fade-down"] {
  transform: translateY(-10px);
}

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

/* ── Responsive ──────────────────────────────── */
@media (max-width: 480px) {
  .container {
    padding: 50px 16px 32px;
  }
  .logo-img, .logo-wrapper {
    width: 90px;
    height: 90px;
  }
  .link-card {
    padding: 14px 16px;
    gap: 12px;
  }
  .card-icon-wrap {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }
  .stats-row { gap: 6px; }
}

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