/* ============================================
   منصة أروى التعليمية - التصميم العصري الفاخر
   الألوان: أسود (Black) + جملي (Camel)
   الإصدار: 2.0
   ============================================ */

/* --- CSS Variables - نظام التصميم المحسّن --- */
:root {
  /* === Color Palette - Black & Camel === */

  /* الأسود - درجات عميقة وفاخرة */
  --color-bg: #050508;
  --color-bg-secondary: #0a0a0f;
  --color-bg-tertiary: #101018;
  --color-bg-card: #0d0d14;
  --color-bg-elevated: #141420;

  /* الجملي - درجات دافئة وأنيقة */
  --color-camel: #d4a574;
  --color-camel-light: #e8c49a;
  --color-camel-lighter: #f0d5b0;
  --color-camel-dark: #b8895c;
  --color-camel-darker: #8f6b42;

  /* ألوان التمييز */
  --color-accent: #f5e6d3;
  --color-accent-light: #fff8f0;
  --color-gold: #ffd700;

  /* النصوص */
  --color-text: #f8f8f8;
  --color-text-secondary: #e0e0e0;
  --color-text-muted: #a0a0a0;
  --color-text-dim: #606060;

  /* الحدود */
  --color-border: rgba(212, 165, 116, 0.12);
  --color-border-hover: rgba(212, 165, 116, 0.4);
  --color-border-active: rgba(212, 165, 116, 0.6);

  /* === Glassmorphism المحسّن === */
  --glass-bg: rgba(10, 10, 15, 0.85);
  --glass-bg-light: rgba(20, 20, 30, 0.75);
  --glass-border: rgba(212, 165, 116, 0.08);
  --glass-border-hover: rgba(212, 165, 116, 0.2);

  /* === Typography === */
  --font-main: "Cairo", sans-serif;

  /* === Shadows - ظلال متعددة المستويات === */
  --shadow-xs: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 30px 80px rgba(0, 0, 0, 0.7);

  /* === Glow Effects - تأثيرات التوهج === */
  --glow-camel: 0 0 20px rgba(212, 165, 116, 0.3);
  --glow-camel-strong:
    0 0 40px rgba(212, 165, 116, 0.4), 0 0 80px rgba(212, 165, 116, 0.2);
  --glow-neon:
    0 0 10px var(--color-camel), 0 0 20px rgba(212, 165, 116, 0.5),
    0 0 40px rgba(212, 165, 116, 0.3), 0 0 80px rgba(212, 165, 116, 0.1);
  --glow-text: 0 0 30px rgba(212, 165, 116, 0.5);

  /* تأثير الظل المتدرج للبطاقات */
  --shadow-card:
    0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(212, 165, 116, 0.05);
  --shadow-card-hover:
    0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 165, 116, 0.15),
    var(--glow-camel);

  /* === Transitions - انتقالات محسّنة === */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* === Border Radius === */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* === Gradients - تدرجات لونية === */
  --gradient-camel: linear-gradient(
    135deg,
    var(--color-camel-light) 0%,
    var(--color-camel) 50%,
    var(--color-camel-dark) 100%
  );
  --gradient-camel-soft: linear-gradient(
    135deg,
    rgba(212, 165, 116, 0.2) 0%,
    rgba(212, 165, 116, 0.05) 100%
  );
  --gradient-dark: linear-gradient(
    180deg,
    var(--color-bg) 0%,
    var(--color-bg-secondary) 100%
  );
  --gradient-radial: radial-gradient(
    ellipse at center,
    var(--color-bg-tertiary) 0%,
    var(--color-bg) 70%
  );
  --gradient-glow: radial-gradient(
    ellipse at 50% 0%,
    rgba(212, 165, 116, 0.15) 0%,
    transparent 60%
  );
  --gradient-border: linear-gradient(
    135deg,
    var(--color-camel),
    transparent 50%,
    var(--color-camel-dark)
  );
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.8;
  overflow-x: hidden;
  direction: rtl;
  min-height: 100vh;
  position: relative;
}

/* === Animated Background - خلفية متحركة فاخرة === */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
        /* توهج علوي */
    radial-gradient(
      ellipse 80% 50% at 50% -20%,
      rgba(212, 165, 116, 0.12) 0%,
      transparent 50%
    ),
    /* توهج جانبي يمين */
    radial-gradient(
        ellipse 50% 80% at 100% 50%,
        rgba(212, 165, 116, 0.06) 0%,
        transparent 50%
      ),
    /* توهج جانبي يسار */
    radial-gradient(
        ellipse 50% 80% at 0% 50%,
        rgba(184, 137, 92, 0.05) 0%,
        transparent 50%
      ),
    /* توهج سفلي */
    radial-gradient(
        ellipse 80% 50% at 50% 120%,
        rgba(143, 107, 66, 0.08) 0%,
        transparent 50%
      );
  pointer-events: none;
  z-index: -1;
  /* animation: bgPulse 20s ease-in-out infinite alternate; */
}

/* === Grain Texture Overlay - نسيج حبيبي === */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.015;
  pointer-events: none;
  z-index: -1;
}

@keyframes bgPulse {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
  }

  100% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* === Floating Particles Animation === */
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-10px) rotate(2deg);
  }

  50% {
    transform: translateY(-20px) rotate(0deg);
  }

  75% {
    transform: translateY(-10px) rotate(-2deg);
  }
}

@keyframes shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes glow {
  0%,
  100% {
    filter: drop-shadow(0 0 15px rgba(212, 165, 116, 0.3));
  }

  50% {
    filter: drop-shadow(0 0 25px rgba(212, 165, 116, 0.5));
  }
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-normal);
}

ul {
  list-style: none;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   HEADER - تصميم عصري فاخر
   ============================================ */
.main-header {
  background: linear-gradient(
    180deg,
    rgba(5, 5, 8, 0.95) 0%,
    rgba(10, 10, 15, 0.9) 100%
  );
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: all var(--transition-normal);
}

/* Header Glow Effect on Scroll */
.main-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-camel) 20%,
    var(--color-camel-light) 50%,
    var(--color-camel) 80%,
    transparent 100%
  );
  opacity: 0.3;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

/* === Logo Styling - شعار متحرك === */
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-camel);
  transition: var(--transition-normal);
  position: relative;
}

.logo:hover {
  transform: scale(1.03);
}

.logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
  filter: drop-shadow(0 0 12px rgba(212, 165, 116, 0.3));
  /* animation: logoGlow 4s ease-in-out infinite; */
}

@keyframes logoGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 12px rgba(212, 165, 116, 0.3));
  }

  50% {
    filter: drop-shadow(0 0 20px rgba(212, 165, 116, 0.5));
  }
}

.logo:hover .logo-img {
  filter: drop-shadow(0 0 25px rgba(212, 165, 116, 0.6));
  transform: rotate(-5deg) scale(1.05);
}

.logo-text {
  background: var(--gradient-camel);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  letter-spacing: 0.5px;
  /* animation: shimmer 4s ease-in-out infinite; */
}

/* === Navigation - شريط تنقل عصري === */
nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 10, 15, 0.5);
  padding: 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
}

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Animated underline effect */
.nav-link::before {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--gradient-camel);
  border-radius: var(--radius-full);
  transition: transform var(--transition-normal);
}

/* Background glow on hover */
.nav-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(212, 165, 116, 0.15) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity var(--transition-normal);
  border-radius: var(--radius-full);
}

.nav-link:hover {
  color: var(--color-camel-light);
  background: rgba(212, 165, 116, 0.1);
  text-shadow: var(--glow-text);
}

.nav-link:hover::before {
  transform: translateX(-50%) scaleX(1);
}

.nav-link:hover::after {
  opacity: 1;
}

/* Active state */
.nav-link.active {
  color: var(--color-camel);
  background: rgba(212, 165, 116, 0.15);
}

/* Nav icon styling */
.nav-link i {
  font-size: 1.1rem;
  transition: transform var(--transition-normal);
}

.nav-link:hover i {
  transform: scale(1.15);
}

/* ============================================
   HERO SECTION
   ============================================ */
/* ============================================
   HERO SECTION - الواجهة الرئيسية
   ============================================ */
.hero {
  text-align: center;
  padding: 8rem 1rem 6rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

/* Background Glow Effect */
.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(
    circle at center,
    rgba(212, 165, 116, 0.08) 0%,
    rgba(5, 5, 8, 0) 60%
  );
  pointer-events: none;
  z-index: -1;
  /* animation: pulseGlow 8s ease-in-out infinite alternate; */
}

@keyframes pulseGlow {
  0% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.9);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 900;
  margin-bottom: 2rem;
  line-height: 1.1;
  position: relative;
  z-index: 1;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Badge styled decoration */
.hero h1::before {
  content: "✨ منصة تعليمية متكاملة";
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-camel);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  /* animation: fadeInDown 1s ease-out forwards; */
}

/* Gradient Text - Camel Colors */
.gradient-text {
  background: linear-gradient(
    135deg,
    var(--color-camel-lighter) 0%,
    var(--color-camel) 25%,
    var(--color-camel-light) 50%,
    var(--color-camel) 75%,
    var(--color-camel-dark) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* animation: shimmer 5s linear infinite; */
  display: inline-block;
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.8;
  position: relative;
  z-index: 1;
  /* animation: fadeInUp 1s ease-out 0.3s forwards; */
  opacity: 1;
  /* Force opacity to 1 since animation is removed */
}

/* Hero Buttons Container */
.hero-actions {
  margin-top: 3rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  /* animation: fadeInUp 1s ease-out 0.6s forwards; */
  opacity: 1;
  /* Force opacity to 1 since animation is removed */
}

/* Floating Particles Container */
.particles-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--color-camel);
  opacity: 0.3;
  /* animation: floatParticle 10s infinite linear; */
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 0.3;
  }

  90% {
    opacity: 0.3;
  }

  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

/* ============================================
   GRID & CARDS
   ============================================ */
/* ============================================
   GRID & CARDS - بطاقات ثلاثية الأبعاد
   ============================================ */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  padding: 3rem 0;
  perspective: 1000px;
}

/* توسيط البطاقات في الشاشة للصفحات بها عدد قليل من البطاقات */
.grid-container.grade-menu-center {
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  justify-items: center;
  align-items: start;
  max-width: 960px; /* allow wider layout for 2x2 grid */
  margin: 0 auto;
}

/* Wide cards (span full row) for highlighted grades */
.grid-container.grade-menu-center .card.wide {
  grid-column: 1 / -1;
  max-width: 820px;
}

@media (max-width: 1200px) {
  .grid-container.grade-menu-center {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }

  .grid-container.grade-menu-center .card.wide {
    max-width: 700px;
  }
}

@media (max-width: 768px) {
  .grid-container.grade-menu-center {
    grid-template-columns: 1fr;
    max-width: 500px;
  }

  .grid-container.grade-menu-center .card.wide {
    grid-column: auto; /* stop spanning on small screens */
    max-width: 100%;
  }
}

/* Card Design */
.card {
  background: linear-gradient(
    145deg,
    rgba(13, 13, 20, 0.6) 0%,
    rgba(5, 5, 10, 0.4) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform-style: preserve-3d;
  box-shadow: var(--shadow-sm);
}

/* Card Content Layer */
.card > * {
  position: relative;
  z-index: 2;
  transform: translateZ(20px);
}

/* Hover Effect - 3D Tilt & Glow */
.card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: rgba(212, 165, 116, 0.3);
  box-shadow: var(--shadow-card-hover);
}

/* Animated Border Glow */
.card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: var(--gradient-border);
  border-radius: 26px;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  filter: blur(10px);
}

.card:hover::before {
  opacity: 0.6;
}

/* Inner overlay gradient */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(212, 165, 116, 0.08) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}

.card:hover::after {
  opacity: 1;
}

/* Card Icon Box */
.card .icon {
  font-size: 3.5rem;
  margin-bottom: 2rem;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(212, 165, 116, 0.05);
  border: 1px solid var(--glass-border);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.card .icon::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--color-camel);
  border-right-color: var(--color-camel-dark);
  opacity: 0;
  transition: all 0.5s ease;
  transform: rotate(45deg);
}

.card:hover .icon {
  transform: scale(1.1) rotate(5deg) translateZ(30px);
  background: rgba(212, 165, 116, 0.1);
  box-shadow: 0 0 30px rgba(212, 165, 116, 0.2);
  border-color: rgba(212, 165, 116, 0.3);
}

.card:hover .icon::before {
  opacity: 1;
  transform: rotate(225deg);
  inset: -8px;
}

/* Card Typography */
.card h3 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--color-camel);
  font-weight: 800;
  transition: color 0.3s ease;
  letter-spacing: 0.5px;
}

.card:hover h3 {
  color: var(--color-camel-light);
  text-shadow: 0 0 15px rgba(212, 165, 116, 0.4);
  transform: translateZ(25px);
}

.card p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  transition: color 0.3s ease;
  transform: translateZ(20px);
}

.card:hover p {
  color: var(--color-text-secondary);
}

/* ============================================
   SUBJECT PAGE
   ============================================ */
/* ============================================
   SUBJECT PAGE - صفحة المواد
   ============================================ */
.subject-hero {
  margin: 4rem 0 5rem;
  text-align: center;
  position: relative;
  padding: 3rem;
  background: radial-gradient(
    circle at center,
    rgba(212, 165, 116, 0.05) 0%,
    transparent 70%
  );
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
}

.subject-hero h1 {
  color: var(--color-camel);
  margin-bottom: 1rem;
  font-size: 3rem;
  text-shadow: 0 0 20px rgba(212, 165, 116, 0.3);
}

.subject-hero p {
  font-size: 1.2rem;
  color: var(--color-text-secondary);
}

/* Section Title */
.section-title {
  color: var(--color-camel) !important;
  font-size: 1.8rem;
  margin: 4rem 0 2rem !important;
  padding: 1rem 2rem;
  background: linear-gradient(
    90deg,
    rgba(212, 165, 116, 0.1) 0%,
    transparent 100%
  );
  border-right: 4px solid var(--color-camel);
  border-radius: var(--radius-sm);
  display: inline-block;
  min-width: 300px;
}

/* Lesson List */
.lesson-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.lesson-item {
  background: linear-gradient(
    145deg,
    rgba(20, 20, 25, 0.8),
    rgba(10, 10, 15, 0.9)
  );
  backdrop-filter: blur(10px);
  padding: 1.8rem 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.lesson-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-camel);
  opacity: 0.5;
  transition: all 0.3s ease;
}

.lesson-item:hover {
  transform: translateY(-5px) translateX(-5px);
  border-color: rgba(212, 165, 116, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.lesson-item:hover::before {
  opacity: 1;
  width: 6px;
  box-shadow: 0 0 15px var(--color-camel);
}

.lesson-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  transition: color 0.3s ease;
}

.lesson-item:hover .lesson-title {
  color: var(--color-camel-light);
}

/* Button Styles */
.btn-start {
  background: linear-gradient(
    135deg,
    var(--color-camel),
    var(--color-camel-dark)
  );
  color: var(--color-bg);
  padding: 0.7rem 1.8rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition-normal);
  white-space: nowrap;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(193, 154, 107, 0.3);
}

.btn-start:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(193, 154, 107, 0.4);
}

/* ============================================
   FOOTER
   ============================================ */
/* ============================================
   FOOTER - تذييل الصفحة
   ============================================ */
footer {
  text-align: center;
  padding: 4rem 2rem;
  border-top: 1px solid var(--glass-border);
  color: var(--color-text-dim);
  background: linear-gradient(
    180deg,
    rgba(8, 8, 12, 0.95) 0%,
    rgba(5, 5, 5, 1) 100%
  );
  backdrop-filter: blur(20px);
  margin-top: auto;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: radial-gradient(
    circle at center,
    var(--color-camel),
    transparent 80%
  );
  opacity: 0.5;
}

footer p {
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.animate-fade-in {
  /* animation: fadeInUp 0.6s ease-out forwards; */
  opacity: 1;
}

/* Staggered Animation */
.card:nth-child(1) {
  animation-delay: 0.1s;
}

.card:nth-child(2) {
  animation-delay: 0.2s;
}

.card:nth-child(3) {
  animation-delay: 0.3s;
}

.card:nth-child(4) {
  animation-delay: 0.4s;
}

.card:nth-child(5) {
  animation-delay: 0.5s;
}

.card:nth-child(6) {
  animation-delay: 0.6s;
}

.card:nth-child(7) {
  animation-delay: 0.7s;
}

.lesson-item:nth-child(1) {
  animation-delay: 0.05s;
}

.lesson-item:nth-child(2) {
  animation-delay: 0.1s;
}

.lesson-item:nth-child(3) {
  animation-delay: 0.15s;
}

.lesson-item:nth-child(4) {
  animation-delay: 0.2s;
}

.lesson-item:nth-child(5) {
  animation-delay: 0.25s;
}

.lesson-item:nth-child(6) {
  animation-delay: 0.3s;
}

.lesson-item:nth-child(7) {
  animation-delay: 0.35s;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .hero {
    padding: 4rem 1rem 3rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .grid-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0 4rem;
  }

  .card {
    padding: 2rem 1.5rem;
  }

  .logo-img {
    width: 42px;
    height: 42px;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .lesson-item {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .btn-start {
    width: 100%;
  }

  /* Mobile navigation */
  nav {
    padding: 4px;
    gap: 2px;
  }

  .nav-link {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
  }

  .nav-link span {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .header-content {
    gap: 10px;
  }

  .logo-img {
    width: 35px;
    height: 35px;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .card .icon {
    width: 70px;
    height: 70px;
    font-size: 2.5rem;
  }

  footer {
    padding: 2rem 1rem;
  }
}

/* ============================================
   UTILITIES & SCROLLBAR
   ============================================ */
.text-camel {
  color: var(--color-camel);
}

.text-muted {
  color: var(--color-text-muted);
}

/* Premium Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  /* Slimmer scrollbar */
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--color-camel-dark),
    var(--color-camel)
  );
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(212, 165, 116, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-camel-light);
}

/* Selection */
::selection {
  background: var(--color-camel);
  color: var(--color-bg);
}

/* Loading Placeholder */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(212, 165, 116, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-camel);
  /* animation: spin 1s ease-in-out infinite; */
  margin: 2rem auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   COMPATIBILITY & THEME OVERRIDES
   Fix for legacy content showing red colors
   ============================================ */
:root {
  /* Override legacy variables to match new theme */
  --accent-red: var(--color-camel);
  --chart-color-2: var(--color-camel-dark);
  --text-red-400: var(--color-camel);
  --text-red-300: var(--color-camel-light);
  --color-danger: var(--color-camel-dark);
}

/* Force specific classes to use camel theme */
.text-red-300,
.text-red-400,
.text-red-500,
.text-red-600 {
  color: var(--color-camel) !important;
}

.bg-red-600,
.bg-red-500 {
  background-color: var(--color-camel-dark) !important;
}

/* Override generic red classes */
.red,
.light.red,
.signal.red {
  background-color: rgba(212, 165, 116, 0.2) !important;
  color: var(--color-camel) !important;
  border-color: var(--color-camel) !important;
}

*[style*="color: #ff"],
*[style*="color: red"],
*[style*="color: #f00"] {
  color: var(--color-camel) !important;
}

*[style*="background-color: #ff"],
*[style*="background-color: #f00"] {
  background-color: var(--color-camel-dark) !important;
}

/* New Button Style to replace any red buttons */
.btn-start {
  display: inline-block;
  background: linear-gradient(135deg, var(--camel-dark), var(--camel-main));
  color: var(--white);
  padding: 0.8rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--camel-light);
}

.btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(193, 154, 107, 0.4);
  background: linear-gradient(135deg, var(--camel-main), var(--camel-light));
  color: var(--black-main);
}

/* === Button inside cards === */
.card-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.8rem 2rem;
  background: linear-gradient(
    135deg,
    var(--color-camel-light),
    var(--color-camel)
  );
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(212, 165, 116, 0.3);
  position: relative;
  z-index: 3;
  transform: translateZ(30px);
}

.card-btn:hover {
  transform: translateY(-3px) scale(1.05) translateZ(30px);
  box-shadow: 0 8px 30px rgba(212, 165, 116, 0.5);
  background: linear-gradient(
    135deg,
    var(--color-camel),
    var(--color-camel-light)
  );
}

.card-btn:active {
  transform: translateY(-1px) translateZ(30px);
}

/* === Coming Soon Badge === */
.coming-soon-badge {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.8rem 2rem;
  background: linear-gradient(
    135deg,
    rgba(212, 165, 116, 0.2),
    rgba(212, 165, 116, 0.1)
  );
  color: var(--color-camel-light);
  border: 1.5px solid var(--color-camel-dark);
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  position: relative;
  z-index: 3;
  transform: translateZ(30px);
  box-shadow: inset 0 0 15px rgba(212, 165, 116, 0.1);
  animation: comingSoonPulse 2s ease-in-out infinite;
}

@keyframes comingSoonPulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 15px rgba(212, 165, 116, 0.1),
      0 0 20px rgba(212, 165, 116, 0.2);
  }
  50% {
    box-shadow:
      inset 0 0 15px rgba(212, 165, 116, 0.2),
      0 0 30px rgba(212, 165, 116, 0.3);
  }
}

/* === Grade actions (دروس / اختبارات) - visible by default, responsive layout === */
.grade-actions {
  display: flex;
  margin-top: 1.2rem;
  gap: 0.8rem;
  flex-direction: row;
  width: 100%;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition:
    opacity 0.2s var(--transition-normal),
    transform 0.2s var(--transition-normal);
}

/* Buttons inline and compact for cards */
.grade-actions .card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  width: auto;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  min-width: 110px;
}

.grade-actions .card-btn .btn-icon {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* Hover / focus for buttons */
.grade-actions .card-btn:hover,
.grade-actions .card-btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 165, 116, 0.12);
}

/* On very small screens stack vertically */
@media (max-width: 480px) {
  .grade-actions {
    flex-direction: column;
  }
  .grade-actions .card-btn {
    width: 80%;
  }
}

/* Group titles */
.group-title {
  grid-column: 1 / -1;
  width: 100%;
  text-align: right;
  font-size: 1.15rem;
  color: var(--color-camel);
  margin: 1.2rem 0 0.5rem 0;
  font-weight: 800;
}

/* ============================================
   BROWSE TABS - تبويبات التصفح
   ============================================ */

/* Compact Hero for homepage */
.hero.hero-compact {
  min-height: 40vh;
  padding: 4rem 1rem 3rem;
}

.hero.hero-compact h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}

.hero.hero-compact h1::before {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.hero.hero-compact p {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

/* Tabs Container */
.browse-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0;
  margin-bottom: 1rem;
}

/* Tab Button */
.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-muted);
  background: rgba(10, 10, 15, 0.6);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.tab-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-camel-soft);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.tab-btn:hover {
  color: var(--color-camel-light);
  border-color: var(--color-border-hover);
  transform: translateY(-3px);
  box-shadow: var(--glow-camel);
}

.tab-btn:hover::before {
  opacity: 1;
}

.tab-btn.active {
  color: var(--color-bg);
  background: var(--gradient-camel);
  border-color: var(--color-camel);
  box-shadow: var(--glow-camel-strong);
}

.tab-btn.active::before {
  opacity: 0;
}

.tab-btn i {
  font-size: 1.3rem;
  position: relative;
  z-index: 1;
}

.tab-btn span {
  position: relative;
  z-index: 1;
}

/* Tab Content */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subjects Grid */
.subjects-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  max-width: 1200px;
  margin: 0 auto;
}

/* Subject Card Styling */
.subject-card {
  background: linear-gradient(
    145deg,
    rgba(13, 13, 20, 0.7) 0%,
    rgba(5, 5, 10, 0.5) 100%
  );
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.subject-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(212, 165, 116, 0.4);
  box-shadow: var(--shadow-card-hover);
}

.subject-card .icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(212, 165, 116, 0.08);
  border: 1px solid var(--glass-border);
  transition: all 0.4s ease;
}

.subject-card:hover .icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(212, 165, 116, 0.15);
  box-shadow: 0 0 25px rgba(212, 165, 116, 0.25);
  border-color: rgba(212, 165, 116, 0.4);
}

.subject-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--color-camel);
  font-weight: 700;
}

.subject-card:hover h3 {
  color: var(--color-camel-light);
  text-shadow: 0 0 12px rgba(212, 165, 116, 0.4);
}

.subject-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Grades Badge in Subject Card */
.subject-card .grades-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: auto;
}

.subject-card .grade-tag {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  background: rgba(212, 165, 116, 0.1);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: var(--radius-full);
  color: var(--color-camel);
  font-weight: 600;
}

/* Subject Page - All Grades View */
.grade-section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.grade-section-title {
  font-size: 1.4rem;
  color: var(--color-camel);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.grade-section-title i {
  font-size: 1.2rem;
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
  .browse-tabs {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .tab-btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .hero.hero-compact {
    min-height: 30vh;
    padding: 3rem 1rem 2rem;
  }
}

@media (max-width: 480px) {
  .tab-btn {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
  }

  .tab-btn i {
    font-size: 1.1rem;
  }
}

/* ============================================
   Bint El-Shemy Custom Card Home Hover Fix
   ============================================ */
.card.bint-special-card {
  border-color: rgba(0, 191, 255, 0.3) !important;
  background: linear-gradient(145deg, rgba(10, 25, 47, 0.3) 0%, rgba(5, 5, 10, 0.25) 100%) !important;
  box-shadow: 0 8px 30px rgba(0, 191, 255, 0.1) !important;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.card.bint-special-card:hover {
  transform: translateY(-10px) scale(1.02) !important;
  border-color: #00BFFF !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 191, 255, 0.2), 0 0 25px rgba(0, 191, 255, 0.35) !important;
}

.card.bint-special-card:hover h3 {
  color: #00F0FF !important;
  text-shadow: 0 0 15px rgba(0, 191, 255, 0.6) !important;
}

.card.bint-special-card .icon {
  background: rgba(0, 191, 255, 0.05) !important;
  border-color: rgba(0, 191, 255, 0.15) !important;
  color: #00BFFF !important;
}

.card.bint-special-card:hover .icon {
  background: rgba(0, 191, 255, 0.12) !important;
  border-color: #00BFFF !important;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.2) !important;
}

.card.bint-special-card p {
  color: #cbd5e1 !important;
}

.card.bint-special-card:hover p {
  color: #ffffff !important;
}

.card.bint-special-card .grade-actions a {
  background: linear-gradient(135deg, #00BFFF, #1E90FF) !important;
  color: #ffffff !important;
  border: none !important;
}

.card.bint-special-card .grade-actions a:hover {
  filter: brightness(1.2) !important;
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.5) !important;
}
