/* =====================================================
   home.css — خاص بالصفحة الرئيسية (index.html) فقط
   بيتحمّل بعد style.css
   ===================================================== */


/* ========== قسم الترحيب (Hero) ========== */
.hero {
  background: var(--primary);           /* الهيرو بلون الموقع الأساسي */
  border-bottom: 4px solid var(--accent); /* خط نعناعي أسفل القسم */
  color: var(--white);                  /* لون النص أبيض */
  text-align: center;                   /* توسيط النص */
  padding: 80px 0;                      /* مسافة فوق وتحت */
}

/* أزرار الهيرو: الأساسي أبيض لأن خلفية القسم بلون الأساسي */
.hero .btn-primary {
  background: var(--white);
  border-color: var(--white);
  color: var(--primary);
}
.hero .btn-primary:hover {
  background: var(--primary-soft);
  border-color: var(--primary-soft);
}
.hero .btn-outline {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.85);
}
.hero .btn-outline:hover {
  background: rgba(255, 255, 255, 0.14);
}

.hero h1 {
  color: var(--white);                  /* بنلغي الأزرق العام للعناوين */
  font-size: clamp(1.8rem, 5vw, 2.8rem); /* حجم متجاوب: بين 1.8rem و2.8rem حسب عرض الشاشة */
  margin-bottom: 12px;                  /* مسافة تحت العنوان */
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.2rem); /* حجم متجاوب للفقرة */
  color: rgba(255, 255, 255, 0.9);      /* أبيض خفيف */
  margin-bottom: 28px;                  /* مسافة قبل الأزرار */
}

.hero-buttons {
  display: flex;                        /* الزرين جنب بعض */
  justify-content: center;              /* بنص الصفحة */
  flex-wrap: wrap;                      /* لو ما اتسعوا ينزل واحد تحت التاني */
  gap: 14px;                            /* مسافة بينهم */
}


/* ========== قسم "ماذا يمكنك أن تفعل؟" ========== */
.features {
  padding: 50px 0;                      /* مسافة فوق وتحت القسم */
}

.section-title {
  text-align: center;                   /* توسيط العنوان */
  color: var(--heading);                /* لون العناوين */
  font-size: 1.6rem;                    /* حجم الخط */
  margin-bottom: 30px;                  /* مسافة قبل الكروت */
}

.features-grid {
  display: grid;                        /* نظام الشبكة */
  grid-template-columns: repeat(4, 1fr); /* 4 أعمدة متساوية */
  gap: 20px;                            /* مسافة بين الكروت */
}

.feature-card {
  display: block;                       /* الرابط يصير كتلة وياخد العرض كامل */
  padding: 28px 16px;                   /* مسافة داخلية */
  background: var(--c-light);           /* اللون الفاتح الخاص بكل كرت (من كلاس card-* بالملف المشترك) */
  border: 1px solid rgba(0, 0, 0, 0.05); /* إطار خفيف جداً */
  border-radius: 10px;                  /* زوايا دائرية */
  text-align: center;                   /* كل شي بالنص */
  transition: border-color 0.2s ease, box-shadow 0.2s ease; /* حركة ناعمة */
}

.feature-card:hover {
  border-color: var(--c);               /* إطار بلون الكرت */
  box-shadow: 0 4px 14px rgba(15, 58, 79, 0.12); /* ظل خفيف */
}

.feature-icon {
  display: flex;                        /* لتوسيط الأيقونة */
  align-items: center;                  /* توسيط عمودي */
  justify-content: center;              /* توسيط أفقي */
  width: 56px;                          /* عرض المربع */
  height: 56px;                         /* ارتفاع المربع */
  margin: 0 auto 14px;                  /* بنوسّطه أفقياً + مسافة تحته */
  border-radius: 8px;                   /* زوايا رسمية */
  background: var(--c);                 /* اللون الغامق الخاص بكل كرت */
  color: var(--on-c, #fff);             /* الأيقونة بلون مناسب لخلفيتها */
  font-size: 1.5rem;                    /* حجم الأيقونة */
}

.feature-card h3 {
  font-size: 1.05rem;                   /* حجم عنوان الكرت */
  color: #1F2A37;                   /* كحلي */
  margin-bottom: 4px;                   /* مسافة صغيرة تحته */
}

.feature-card p {
  font-size: 0.9rem;                    /* خط أصغر للوصف */
  color: var(--text-muted);             /* رمادي */
}


/* =====================================================
   التجاوب (لازم بعد القواعد الأساسية فوق)
   ===================================================== */

/* ===== تابلت: عمودين ===== */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr); /* بدل 4 أعمدة صار عمودين */
  }
}

/* ===== جوال ===== */
@media (max-width: 768px) {
  .hero {
    padding: 70px 0;                    /* بنصغّر ارتفاع الـ Hero */
  }
}

/* ===== جوال صغير: عمود واحد ===== */
@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr;         /* كرت واحد بكل سطر */
  }

  .hero {
    padding: 56px 0;                    /* ارتفاع أصغر */
  }

  .hero-buttons .btn {
    width: 100%;                        /* الأزرار بعرض الشاشة (أسهل بالضغط) */
  }
}

/* أيقونات مسطحة بدون تدرجات */
.feature-icon{background:var(--c);border:0;border-radius:8px;box-shadow:none}
.feature-icon::before,.feature-icon::after{content:none}
.feature-icon i{filter:none}
body.dark-mode .feature-card{background:#13212F;border-color:#284459}
body.dark-mode .feature-card:hover{border-color:var(--c)}
body.dark-mode .feature-card h3{color:#E3EDF5}
body.dark-mode .section-title{color:#BDF3E9}


/* =====================================================
   لوحة "اليوم" (today.js) — للمستخدم المسجّل فقط
   ===================================================== */
.today {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); /* تدرّج بألوان الموقع */
  padding: 36px 0 44px;                 /* مسافة فوق وتحت */
  border-bottom: 4px solid var(--accent); /* خط نعناعي مثل الهيرو */
}
.today-title { color: var(--white); font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 4px; } /* الترحيب */
.today-date  { color: rgba(255, 255, 255, 0.85); margin-bottom: 22px; }                          /* التاريخ */
.today-grid {
  display: grid;                        /* شبكة */
  grid-template-columns: 1.4fr 1fr 1fr; /* المحاضرات أعرض شوي */
  gap: 16px;                            /* مسافة بين البطاقات */
}
.today-card {
  background: var(--surface);             /* بطاقة بيضاء */
  color: var(--text);                   /* لون النص */
  border-radius: 12px;                  /* زوايا دائرية */
  padding: 18px;                        /* مسافة داخلية */
  box-shadow: 0 6px 18px rgba(15, 30, 60, 0.18); /* ظل */
}
.today-card h3 { font-size: 1rem; color: var(--heading); margin-bottom: 12px; } /* عنوان البطاقة */
.today-row {
  display: flex;                        /* عناصر بصف */
  align-items: center;                  /* توسيط عمودي */
  gap: 8px;                             /* مسافة */
  padding: 8px 0;                       /* مسافة عمودية */
  border-top: 1px solid var(--border);  /* فاصل خفيف */
  flex-wrap: wrap;                      /* ينزل لسطر لو ضاق */
}
.today-row:first-of-type { border-top: 0; } /* أول سطر بدون فاصل */
.today-name { font-weight: 700; flex: 1; }  /* اسم المادة/المهمة */
.today-meta { color: var(--text-muted); font-size: 0.85rem; } /* نص ثانوي */
.today-done { opacity: 0.45; }              /* محاضرة انتهت */
.today-empty { color: var(--text-muted); padding: 8px 0; } /* رسالة فاضية */
.today-big { font-size: 2.6rem; font-weight: 800; color: var(--primary); line-height: 1.1; } /* رقم الأيام */
.today-urgent { color: var(--danger); }     /* امتحان قريب = أحمر */
.today-link { display: inline-block; margin-top: 8px; color: var(--link); font-weight: 700; } /* رابط المهام */

/* الوضع الداكن للبطاقات */
body.dark-mode .today-card { background: #13212F; color: #E3EDF5; }
body.dark-mode .today-card h3 { color: #BFD9EA; }
body.dark-mode .today-row { border-color: #284459; }

/* تابلت وجوال: عمود واحد */
@media (max-width: 900px) {
  .today-grid { grid-template-columns: 1fr; }
}


/* ===== المحاضرة القادمة (لوحة اليوم) ===== */
.today-card.next-lec { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border: 0; }
.today-card.next-lec h3 { color: rgba(255, 255, 255, 0.9); }
.next-lec-name { font-family: var(--font-heading); font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 800; line-height: 1.2; }
.next-lec-when { margin-top: 4px; font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.next-lec-meta { margin-top: 6px; font-size: 0.9rem; color: rgba(255, 255, 255, 0.85); }
.today-card.next-lec.is-now .next-lec-when { color: #fff; }
.today-card.next-lec .today-empty { color: rgba(255, 255, 255, 0.9); }
body.dark-mode .today-card.next-lec { background: linear-gradient(135deg, #14527A, #2B2070); color: #fff; }
body.dark-mode .today-card.next-lec h3 { color: rgba(255, 255, 255, 0.9); }

/* ========== الهيرو: تدرّج لوني متحرك + كرات ضوئية عائمة (متجاوب) ========== */
.hero{
  position:relative;overflow:hidden;isolation:isolate;
  padding:clamp(56px,9vw,100px) 0;
  background:linear-gradient(125deg,#1D72AA 0%,#2A86C4 25%,#5B6FE0 50%,#22B5A5 75%,#1D72AA 100%);
  background-size:300% 300%;
  animation:heroShift 16s ease-in-out infinite;
}
.hero::before,.hero::after{
  content:"";position:absolute;z-index:-1;border-radius:50%;filter:blur(40px);pointer-events:none;
  width:clamp(180px,34vw,420px);aspect-ratio:1;
}
.hero::before{top:-25%;inset-inline-start:-6%;background:radial-gradient(circle,rgba(97,239,198,.55),transparent 70%);animation:heroFloatA 11s ease-in-out infinite;}
.hero::after{bottom:-35%;inset-inline-end:-6%;background:radial-gradient(circle,rgba(156,147,232,.6),transparent 70%);animation:heroFloatB 13s ease-in-out infinite;}
.hero .container{position:relative;}
.hero h1,.hero p,.hero-buttons{animation:heroRise .8s ease both;}
.hero p{animation-delay:.12s;}
.hero-buttons{animation-delay:.24s;}
.hero .btn{transition:transform .2s ease,box-shadow .2s ease,background .2s ease;}
.hero .btn:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(0,0,0,.2);}
body.dark-mode .hero{
  background-image:linear-gradient(125deg,#0F2E4A 0%,#12395A 28%,#2B2F78 55%,#0F5A63 80%,#0F2E4A 100%);
  background-size:300% 300%;
}
@keyframes heroShift{0%,100%{background-position:0% 50%}50%{background-position:100% 50%}}
@keyframes heroFloatA{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(40px,30px) scale(1.15)}}
@keyframes heroFloatB{0%,100%{transform:translate(0,0) scale(1)}50%{transform:translate(-40px,-28px) scale(1.12)}}
@keyframes heroRise{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@media (max-width:480px){.hero-buttons{padding-inline:6px}}
@media (prefers-reduced-motion:reduce){
  .hero,.hero::before,.hero::after,.hero h1,.hero p,.hero-buttons{animation:none}
}


/* =====================================================
   إعادة ترتيب الرئيسية (للمسجّل): ترحيب ← سلسلة الأيام ← بطاقات اليوم
   ===================================================== */
.today{background:transparent;border-bottom:0;padding:30px 0 6px}
.today-title{color:var(--heading);display:flex;align-items:center;gap:10px;margin-bottom:2px}
.today-date{color:var(--text-muted);margin-bottom:20px}
body.dark-mode .today{background:transparent}

/* --- بطاقات اليوم --- */
.today .today-grid{grid-template-columns:repeat(3,1fr);gap:18px;margin-top:18px}
.today .today-card.next-lec{grid-column:1/-1;padding:24px 26px;border-radius:18px;box-shadow:0 12px 30px rgba(62,46,153,.28)}
.today .today-card:not(.next-lec){position:relative;overflow:hidden;border:1px solid var(--border);border-radius:16px;transition:transform .25s ease,box-shadow .25s ease}
.today .today-card:not(.next-lec)::before{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:linear-gradient(90deg,var(--primary),var(--secondary),var(--accent))}
.today .today-card:not(.next-lec):hover{transform:translateY(-4px);box-shadow:0 14px 28px rgba(15,30,60,.18)}
.today .today-card h3 i{color:var(--primary);margin-inline-end:4px}
.today-grid>*{animation:heroRise .6s ease both}
.today-grid>*:nth-child(2){animation-delay:.08s}.today-grid>*:nth-child(3){animation-delay:.16s}.today-grid>*:nth-child(4){animation-delay:.24s}

/* --- بطاقة سلسلة الأيام: تدرّج متحرك + كرات ضوئية --- */
.streak-card{
  position:relative;overflow:hidden;isolation:isolate;color:#fff;
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:22px;
  padding:24px 28px;border-radius:20px;
  background:linear-gradient(120deg,#1D72AA,#3E2E99,#22B5A5,#5B6FE0,#1D72AA);
  background-size:400% 400%;animation:streakShift 12s ease-in-out infinite;
  box-shadow:0 14px 34px rgba(29,114,170,.35);
}
.streak-card::before,.streak-card::after{content:"";position:absolute;z-index:-1;border-radius:50%;filter:blur(34px);pointer-events:none;width:260px;aspect-ratio:1}
.streak-card::before{top:-40%;inset-inline-start:-4%;background:radial-gradient(circle,rgba(97,239,198,.65),transparent 70%);animation:heroFloatA 9s ease-in-out infinite}
.streak-card::after{bottom:-50%;inset-inline-end:-3%;background:radial-gradient(circle,rgba(255,170,90,.5),transparent 70%);animation:heroFloatB 11s ease-in-out infinite}
.streak-flame{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;font-size:2.4rem;color:#FFD54F;
  background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.35);backdrop-filter:blur(4px);
  animation:flamePulse 2.2s ease-in-out infinite}
.streak-flame i{filter:drop-shadow(0 0 10px rgba(255,170,60,.9));animation:flameFlicker 1.4s ease-in-out infinite}
.streak-label{font-size:.95rem;font-weight:700;opacity:.9}
.streak-count{font-family:var(--font-heading);font-size:1.15rem;font-weight:700}
.streak-count b{font-size:clamp(2.4rem,6vw,3.4rem);line-height:1;margin-inline-end:6px;text-shadow:0 2px 14px rgba(0,0,0,.25);animation:heroRise .7s ease both}
.streak-best{font-size:.85rem;opacity:.85}
.streak-card .streak-next{color:rgba(255,255,255,.92);margin:8px 0 0;font-size:.9rem}
.streak-bar{height:9px;border-radius:99px;background:rgba(255,255,255,.22);overflow:hidden;margin-top:10px;max-width:340px}
.streak-bar span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#61EFC6,#FFD54F);position:relative;overflow:hidden;transition:width 1s ease}
.streak-bar span::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.7) 50%,transparent 70%);transform:translateX(-100%);animation:streakShine 2.6s ease-in-out infinite}
.streak-card .streak-badges{flex-direction:column;align-items:stretch;gap:6px;min-width:150px}
.streak-card .streak-badge{border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.1);color:#fff;opacity:.55;font-size:.8rem;transition:transform .2s ease}
.streak-card .streak-badge.on{opacity:1;background:rgba(255,255,255,.25);border-color:rgba(255,255,255,.7);box-shadow:0 0 14px rgba(255,255,255,.3)}
.streak-card .streak-badge:hover{transform:translateX(-3px)}
body.dark-mode .streak-card{background:linear-gradient(120deg,#0F2E4A,#2B2070,#0F5A63,#2B2F78,#0F2E4A);background-size:400% 400%;box-shadow:0 14px 34px rgba(0,0,0,.45)}

@keyframes streakShift{0%,100%{background-position:0% 50%}50%{background-position:100% 50%}}
@keyframes flamePulse{0%,100%{box-shadow:0 0 0 0 rgba(255,213,79,.45)}50%{box-shadow:0 0 0 14px rgba(255,213,79,0)}}
@keyframes flameFlicker{0%,100%{transform:scale(1) rotate(-3deg)}50%{transform:scale(1.14) rotate(3deg)}}
@keyframes streakShine{to{transform:translateX(100%)}}

@media (max-width:900px){
  .today .today-grid{grid-template-columns:1fr}
}
@media (max-width:700px){
  .streak-card{grid-template-columns:auto 1fr;padding:20px 18px;gap:16px}
  .streak-flame{width:64px;height:64px;font-size:1.8rem}
  .streak-card .streak-badges{grid-column:1/-1;flex-direction:row;flex-wrap:wrap;min-width:0}
}
@media (prefers-reduced-motion:reduce){
  .streak-card,.streak-card::before,.streak-card::after,.streak-flame,.streak-flame i,.streak-bar span::after,.today-grid>*,.streak-count b{animation:none}
}
