/* ═══════════════════════════════════════════════════
   ALFAFA LANDING — Dual Theme (Light default + Dark)
   Cairo font · Smooth transitions · Effects
   ═══════════════════════════════════════════════════ */

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

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
a { text-decoration: none; color: inherit; }

/* ══════════════════════════════════════
   DESIGN TOKENS (CSS Custom Properties)
   Light = default, Dark = body.dark
   ══════════════════════════════════════ */
body {
  /* ── Light theme tokens ── */
  --bg: #FAFBF8;
  --text: #2C2C2C;
  --text-muted: #888;
  --text-faint: #BBB;
  --text-footer: #C0C0C0;
  --card-bg: #FFFFFF;
  --card-border: rgba(0,0,0,0.06);
  --card-shadow: 0 2px 20px rgba(0,0,0,0.04);
  --card-hover-shadow: 0 12px 40px rgba(46,125,50,0.1), 0 4px 16px rgba(0,0,0,0.06);
  --card-hover-border: rgba(46,125,50,0.12);
  --card-title: #2C2C2C;
  --card-title-en: #AAA;
  --card-desc: #999;
  --card-link: #BBB;
  --icon-dates-bg: rgba(200,150,12,0.08);
  --icon-dates-border: rgba(200,150,12,0.06);
  --icon-hold-bg: rgba(46,125,50,0.08);
  --icon-hold-border: rgba(46,125,50,0.06);
  --brand-ar-color: #2E7D32;
  --brand-en-color: #C8960C;
  --tagline-color: rgba(0,0,0,0.35);
  --toggle-bg: rgba(0,0,0,0.06);
  --toggle-border: rgba(0,0,0,0.08);
  --toggle-color: #666;
  --toggle-hover-bg: rgba(0,0,0,0.1);
  --logo-shadow: drop-shadow(0 4px 20px rgba(76,175,80,0.15));
  --glow-border-opacity: 0;
  --bg-glow-opacity: 0;
  --shimmer-color: rgba(200,150,12,0.04);
  --shimmer-hover-color: rgba(200,150,12,0.07);

  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  overflow-x: hidden;
  line-height: 1.7;
  min-height: 100vh;
  transition: background 0.5s ease, color 0.5s ease;
}

/* ── Dark theme overrides ── */
body.dark {
  --bg: #080C06;
  --text: #E0DDD6;
  --text-muted: rgba(224,221,214,0.4);
  --text-faint: rgba(224,221,214,0.3);
  --text-footer: rgba(224,221,214,0.18);
  --card-bg: rgba(255,255,255,0.03);
  --card-border: rgba(255,255,255,0.06);
  --card-shadow: none;
  --card-hover-shadow: 0 20px 60px rgba(200,150,12,0.1), 0 8px 24px rgba(0,0,0,0.3);
  --card-hover-border: rgba(255,255,255,0.1);
  --card-title: #F0EDE6;
  --card-title-en: rgba(224,221,214,0.3);
  --card-desc: rgba(224,221,214,0.4);
  --card-link: rgba(224,221,214,0.3);
  --icon-dates-bg: rgba(200,150,12,0.08);
  --icon-dates-border: rgba(200,150,12,0.06);
  --icon-hold-bg: rgba(46,125,50,0.08);
  --icon-hold-border: rgba(46,125,50,0.06);
  --brand-ar-color: transparent;
  --brand-en-color: rgba(200,150,12,0.45);
  --tagline-color: rgba(224,221,214,0.4);
  --toggle-bg: rgba(255,255,255,0.06);
  --toggle-border: rgba(255,255,255,0.1);
  --toggle-color: #C8960C;
  --toggle-hover-bg: rgba(255,255,255,0.12);
  --logo-shadow: drop-shadow(0 0 20px rgba(76,175,80,0.25)) drop-shadow(0 0 40px rgba(200,150,12,0.1));
  --glow-border-opacity: 0;
  --bg-glow-opacity: 0;
  --shimmer-color: rgba(200,150,12,0.03);
  --shimmer-hover-color: rgba(200,150,12,0.06);
}

/* ── Particles Canvas ── */
#particles-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

body.dark #particles-canvas {
  opacity: 1;
}

/* ── Aurora Background ── */
.aurora {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

body.dark .aurora {
  animation: auroraFadeIn 2s ease-out forwards;
}

.aurora-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -150px;
  background: radial-gradient(circle, rgba(46,125,50,0.12) 0%, rgba(46,125,50,0.03) 50%, transparent 70%);
}

body.dark .aurora-1 {
  animation: auroraFadeIn 2s ease-out forwards, auroraDrift1 18s ease-in-out infinite 2s;
}

.aurora-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  left: -100px;
  background: radial-gradient(circle, rgba(200,150,12,0.1) 0%, rgba(200,150,12,0.02) 50%, transparent 70%);
}

body.dark .aurora-2 {
  animation: auroraFadeIn 2s ease-out 0.5s forwards, auroraDrift2 22s ease-in-out infinite 2.5s;
}

/* ── Light mode soft bg blobs ── */
body:not(.dark)::before,
body:not(.dark)::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body:not(.dark)::before {
  width: 500px;
  height: 500px;
  top: -180px;
  right: -120px;
  background: radial-gradient(circle, rgba(76,175,80,0.06) 0%, transparent 70%);
  animation: auroraDrift1 20s ease-in-out infinite;
}

body:not(.dark)::after {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -100px;
  background: radial-gradient(circle, rgba(200,150,12,0.05) 0%, transparent 70%);
  animation: auroraDrift2 25s ease-in-out infinite;
}

/* ══════════════════════════════
   THEME TOGGLE BUTTON
   ══════════════════════════════ */
.theme-toggle {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: var(--toggle-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.35s ease;
  font-family: inherit;
}

.theme-toggle:hover {
  background: var(--toggle-hover-bg);
  transform: scale(1.08);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* Icon visibility */
.icon-sun { display: none; }
.icon-moon { display: block; }

body.dark .icon-sun { display: block; }
body.dark .icon-moon { display: none; }

/* ══════════════════════════════
   LANDING LAYOUT
   ══════════════════════════════ */
.landing {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 24px;
  gap: 56px;
}

/* ── Brand ── */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: fadeInDown 1s ease-out;
}

.logo-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  padding: 20px 0;
}

.logo-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(76,175,80,0.2) 0%, rgba(200,150,12,0.08) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
}

body.dark .logo-glow {
  opacity: 1;
  animation: glowPulse 4s ease-in-out infinite;
}

.logo-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  opacity: 0;
  transition: opacity 0.6s ease;
}

body.dark .logo-ring {
  opacity: 1;
  animation: ringExpand 4s ease-in-out infinite;
}

.logo-ring-1 {
  width: 130px;
  height: 130px;
  border-color: rgba(76,175,80,0.12);
}

.logo-ring-2 {
  width: 150px;
  height: 150px;
  border-color: rgba(200,150,12,0.08);
  animation-delay: 2s;
}

.logo-icon {
  position: relative;
  z-index: 2;
  filter: var(--logo-shadow);
  transition: filter 0.5s ease;
}

.logo-img {
  width: 100%;
  max-width: 460px;
  height: auto;
  display: block;
}

/* Light mode default */
.logo-light { display: block; }
.logo-dark { display: none; }

/* Dark mode override */
body.dark .logo-light { display: none; }
body.dark .logo-dark { display: block; }

.brand-name {
  text-align: center;
  line-height: 1.15;
}

.brand-ar {
  display: block;
  font-size: 3.4rem;
  font-weight: 900;
  color: var(--brand-ar-color);
  letter-spacing: -0.01em;
  transition: color 0.5s ease;
}

/* Dark mode: gold gradient text */
body.dark .brand-ar {
  background: linear-gradient(135deg, #E8C34A 0%, #C8960C 40%, #E8C34A 70%, #96700A 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease-in-out infinite;
}

.brand-en {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.6em;
  color: var(--brand-en-color);
  text-transform: uppercase;
  margin-top: 4px;
  transition: color 0.5s ease;
}

.brand-tagline {
  font-size: 1rem;
  font-weight: 300;
  color: var(--tagline-color);
  text-align: center;
  margin-top: 4px;
  transition: color 0.5s ease;
}

/* ══════════════════════════════
   CARDS
   ══════════════════════════════ */
.cards-wrapper {
  display: flex;
  gap: 28px;
  width: 100%;
  max-width: 800px;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.card {
  position: relative;
  flex: 1;
  display: flex;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  transition: all 0.5s cubic-bezier(0.23,1,0.32,1);
}

body.dark .card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: var(--card-hover-shadow);
  border-color: var(--card-hover-border);
}

/* Card background glow (dark mode only) */
.card-bg-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
}

body.dark .card:hover .card-bg-glow {
  opacity: 1;
}

/* Animated gradient border (dark mode only) */
.card-border-glow {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  padding: 1px;
  background: linear-gradient(
    var(--border-angle, 0deg),
    rgba(200,150,12,0.3),
    transparent 40%,
    rgba(76,175,80,0.2) 60%,
    transparent 80%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  animation: rotateBorder 4s linear infinite;
}

body.dark .card:hover .card-border-glow {
  opacity: 1;
}

/* Light mode shimmer */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, var(--shimmer-color) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.card:hover::after {
  background: linear-gradient(120deg, transparent 30%, var(--shimmer-hover-color) 50%, transparent 70%);
  background-size: 200% 100%;
  animation-duration: 2s;
}

/* Card Content */
.card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 44px 28px 36px;
  width: 100%;
  text-align: center;
}

.card-icon-wrap {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  transition: all 0.5s cubic-bezier(0.23,1,0.32,1);
}

.card-dates .card-icon-wrap {
  background: var(--icon-dates-bg);
  box-shadow: 0 0 0 1px var(--icon-dates-border);
}

.card-holding .card-icon-wrap {
  background: var(--icon-hold-bg);
  box-shadow: 0 0 0 1px var(--icon-hold-border);
}

.card:hover .card-icon-wrap {
  transform: scale(1.1) translateY(-4px);
}

.card-dates:hover .card-icon-wrap {
  box-shadow: 0 8px 32px rgba(200,150,12,0.15), 0 0 0 1px rgba(200,150,12,0.12);
}

.card-holding:hover .card-icon-wrap {
  box-shadow: 0 8px 32px rgba(46,125,50,0.15), 0 0 0 1px rgba(46,125,50,0.12);
}

.card-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title-ar {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--card-title);
  transition: all 0.4s ease;
}

.card-dates:hover .card-title-ar { color: #C8960C; }
body.dark .card-dates:hover .card-title-ar { color: #E8C34A; text-shadow: 0 0 30px rgba(200,150,12,0.2); }
.card-holding:hover .card-title-ar { color: #2E7D32; }
body.dark .card-holding:hover .card-title-ar { color: #81C784; text-shadow: 0 0 30px rgba(76,175,80,0.2); }

.card-title-en {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  color: var(--card-title-en);
  text-transform: uppercase;
  transition: color 0.5s ease;
}

.card-desc {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--card-desc);
  line-height: 1.6;
  max-width: 230px;
  transition: color 0.5s ease;
}

.card-link-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--card-link);
  padding: 8px 0;
  margin-top: 6px;
  transition: all 0.4s ease;
}

.card-link-label svg {
  transition: transform 0.4s ease;
}

.card-dates:hover .card-link-label { color: #C8960C; }
.card-holding:hover .card-link-label { color: #4CAF50; }

.card:hover .card-link-label svg {
  transform: translateX(-5px);
}

/* ── Footer ── */
.landing-footer {
  animation: fadeInUp 1s ease-out 0.6s both;
}

.landing-footer p {
  font-size: 0.78rem;
  color: var(--text-footer);
  text-align: center;
  font-weight: 300;
  transition: color 0.5s ease;
}

/* ═══════ ANIMATIONS ═══════ */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-25px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes gentleSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.15); }
}

@keyframes ringExpand {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.1; transform: scale(1.12); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

@keyframes auroraFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes auroraDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-25px, -15px) scale(1.08); }
  66%      { transform: translate(15px, 25px) scale(0.92); }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotateBorder {
  from { --border-angle: 0deg; }
  to   { --border-angle: 360deg; }
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 680px) {
  .landing { padding: 36px 16px; gap: 40px; }
  .brand-ar { font-size: 2.5rem; }
  .brand-en { font-size: 0.8rem; letter-spacing: 0.4em; }
  .logo-container { width: 130px; height: 130px; }
  .logo-ring-1 { width: 110px; height: 110px; }
  .logo-ring-2 { width: 126px; height: 126px; }

  .cards-wrapper {
    flex-direction: column;
    max-width: 380px;
    gap: 20px;
  }

  .card-content { padding: 32px 20px 28px; }
  .card-title-ar { font-size: 1.35rem; }
  .theme-toggle { top: 16px; left: 16px; width: 40px; height: 40px; }
}

@media (max-width: 380px) {
  .brand-ar { font-size: 2rem; }
  .card-content { padding: 24px 16px 20px; gap: 14px; }
}

/* ═══════ ACCESSIBILITY ═══════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #particles-canvas, .aurora { display: none; }
}

.card:focus-visible {
  outline: 2px solid #C8960C;
  outline-offset: 4px;
}

.theme-toggle:focus-visible {
  outline: 2px solid #C8960C;
  outline-offset: 4px;
}
