/* ============================================
   single-topic.css — صفحة الموضوع الموحّدة
   تصميم مختلف تماماً عن topic.css الموجود.
   يعتمد على --topic-accent المُحقَن من PHP
   وعلى متغيرات :root من main.css.
============================================ */

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

body {
  font-family: 'Tajawal', sans-serif;
  background: #f6f8fa;
  overflow-x: hidden;
}

/* ── Scroll progress bar ── */
.st-scroll-bar {
  position: fixed;
  top: 0; right: 0;
  height: 3px;
  width: 0%;
  background: var(--topic-accent, #062141);
  z-index: 9999;
  transition: width .1s linear;
}

/* ============================================
   HERO — split layout (text | icon card)
   بدلاً من الـ full-width gradient المعتاد:
   نصف داكن (النص) + نصف أبيض (الـ card)
============================================ */
.st-hero {
  position: relative;
  background: #062141;
  overflow: hidden;
  padding-top: 84px; /* header height */
}

/* شبكة خطوط decorative متحركة */
.st-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: stGridDrift 40s linear infinite;
  pointer-events: none;
}
@keyframes stGridDrift {
  from { background-position: 0 0; }
  to   { background-position: 44px 44px; }
}

.st-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 60px 40px 0;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: end;
}

/* ── Hero text (right col in RTL) ── */
.st-hero-text { padding-bottom: 60px; }

.st-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 20px;
}
.st-breadcrumb a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color .2s;
}
.st-breadcrumb a:hover { color: #fff; }
.st-bc-sep { opacity: .35; }

.st-level-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.st-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.st-badge-level { background: var(--topic-accent, #062141); color: #fff; }
.st-badge-dur   { background: rgba(255,255,255,0.1);  color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.15); }
.st-badge-tag   { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6);  border: 1px solid rgba(255,255,255,0.12); }

.st-title {
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin: 0 0 16px;
}

.st-desc {
  font-size: 15.5px;
  color: rgba(255,255,255,0.65);
  line-height: 1.85;
  max-width: 580px;
  margin: 0 0 32px;
}

.st-hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}
.st-hs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
}
.st-hs:first-child { padding-right: 0; }
.st-hs-div { width: 1px; height: 36px; background: rgba(255,255,255,0.15); }
.st-hs-n {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.st-hs-l {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}

.st-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--topic-accent, #062141);
  color: #fff;
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.15);
  transition: all .3s cubic-bezier(0.68,-0.55,0.265,1.55);
}
.st-cta-btn:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 14px 32px rgba(0,0,0,0.38);
  gap: 14px;
}
.st-cta-btn i { font-size: 12px; }

/* ── Hero card (left col in RTL) ── */
.st-hero-card {
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  padding: 40px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-self: stretch;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.2);
}

.st-icon-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 4px;
}
.st-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  animation: stIconFloat 3s ease-in-out infinite;
}
.st-icon-emoji {
  font-size: 72px;
  line-height: 100px;
  display: block;
  text-align: center;
  animation: stIconFloat 3s ease-in-out infinite;
}
.st-icon-glow {
  position: absolute;
  inset: -12px;
  background: radial-gradient(circle, var(--topic-accent,.062141) 0%, transparent 70%);
  opacity: .18;
  border-radius: 50%;
  animation: stGlowPulse 3s ease-in-out infinite;
}
@keyframes stIconFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes stGlowPulse {
  0%,100% { opacity:.18; transform:scale(1); }
  50%      { opacity:.3;  transform:scale(1.1); }
}

.st-prereq h4 {
  font-size: 13px;
  font-weight: 800;
  color: #062141;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.st-prereq h4 i { color: var(--topic-accent, #0a4d4d); }
.st-prereq ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.st-prereq ul li {
  font-size: 13px;
  color: #475569;
  padding-right: 16px;
  position: relative;
  line-height: 1.6;
}
.st-prereq ul li::before {
  content: '◆';
  position: absolute;
  right: 0;
  color: var(--topic-accent, #0a4d4d);
  font-size: 7px;
  top: 6px;
  opacity: .7;
}

/* ============================================
   SECTIONS
============================================ */
.st-section { padding: 72px 0; }
.st-container { max-width: 1160px; margin: 0 auto; padding: 0 40px; }

.st-section-head { text-align: center; margin-bottom: 48px; }
.st-section-head h2 {
  font-size: 30px;
  font-weight: 800;
  color: #062141;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.st-count-pill {
  font-size: 13px;
  background: var(--topic-accent, #062141);
  color: #fff;
  padding: 5px 16px;
  border-radius: 999px;
  font-weight: 700;
  vertical-align: middle;
}
.st-section-sub {
  font-size: 15px;
  color: #64748b;
  max-width: 520px;
  margin: 14px auto 0;
  line-height: 1.7;
}

/* ── ما ستتعلمه grid ── */
.st-learn-section { background: #fff; }
.st-learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.st-learn-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid rgba(6,33,65,0.07);
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 14px;
  color: #334155;
  line-height: 1.7;
  font-weight: 500;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease calc(var(--i, 0) * 70ms),
              transform .5s ease calc(var(--i, 0) * 70ms),
              box-shadow .2s;
}
.st-learn-item.st-in {
  opacity: 1;
  transform: translateY(0);
}
.st-learn-item:hover { box-shadow: 0 4px 16px rgba(6,33,65,0.09); }

.st-learn-check {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--topic-accent, #062141);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-top: 1px;
}

/* ── Videos grid ── */
.st-videos-section { background: #f6f8fa; }
.st-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.st-video-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.07);
  border: 1px solid rgba(6,33,65,0.06);
  position: relative;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s ease calc(var(--vi, 0) * 80ms),
              transform .55s ease calc(var(--vi, 0) * 80ms),
              box-shadow .3s, border-color .3s;
}
.st-video-card.st-in {
  opacity: 1;
  transform: translateY(0);
}
.st-video-card:hover {
  box-shadow: 0 14px 40px rgba(6,33,65,0.14);
  border-color: rgba(6,33,65,0.12);
}

.st-video-num {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  background: var(--topic-accent, #062141);
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 8px;
  letter-spacing: .5px;
}

.st-video-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #0d1b2a;
  overflow: hidden;
}
.st-video-thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.st-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6,33,65,0.38);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.st-video-card:hover .st-play-overlay { opacity: 1; }
.st-play-btn {
  width: 62px; height: 62px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #062141;
  font-size: 22px;
  padding-right: 4px;
  transform: scale(.9);
  transition: transform .25s cubic-bezier(0.68,-0.55,0.265,1.55);
}
.st-video-card:hover .st-play-btn { transform: scale(1.1); }

.st-vid-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0,0,0,.82);
  color: #fff;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  z-index: 3;
}

.st-video-info { padding: 22px 24px; }
.st-video-info h3 {
  font-size: 16px;
  font-weight: 800;
  color: #062141;
  margin: 0 0 8px;
  line-height: 1.5;
}
.st-video-info p {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.7;
}

.st-no-videos {
  text-align: center;
  padding: 70px 20px;
  color: #94a3b8;
}
.st-no-videos i { font-size: 40px; display: block; margin-bottom: 14px; }
.st-no-videos p { font-size: 15px; }

/* ── Back CTA ── */
.st-back-section { padding: 0 0 72px; background: #f6f8fa; }
.st-back-card {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
  background: linear-gradient(135deg, #062141, var(--topic-accent, #002c58));
  border-radius: 22px;
  padding: 44px 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.st-back-text h3 { font-size: 22px; font-weight: 800; color: #fff; margin: 0 0 8px; }
.st-back-text p  { font-size: 14px; color: rgba(255,255,255,.65); margin: 0; }
.st-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all .25s;
}
.st-back-btn:hover {
  background: rgba(255,255,255,.22);
  transform: translateY(-2px);
  gap: 14px;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1060px) {
  .st-hero-inner { grid-template-columns: 1fr 300px; gap: 32px; }
}

@media (max-width: 860px) {
  .st-hero-inner {
    grid-template-columns: 1fr;
    padding: 40px 24px 0;
  }
  .st-hero-text { padding-bottom: 30px; }
  .st-hero-card {
    border-radius: 24px 24px 0 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 28px 24px;
  }
  .st-icon-wrap { width: 70px; height: 70px; flex-shrink: 0; }
  .st-title { font-size: 27px; }
  .st-container { padding: 0 24px; }
  .st-back-card { padding: 32px 28px; }
}

@media (max-width: 560px) {
  .st-title { font-size: 22px; }
  .st-desc { font-size: 14.5px; }
  .st-videos-grid { grid-template-columns: 1fr; }
  .st-learn-grid { grid-template-columns: 1fr; }
  .st-hero-stats { gap: 0; }
  .st-hs-n { font-size: 17px; }
  .st-back-card { padding: 28px 22px; }
  .st-back-text h3 { font-size: 17px; }
  .st-section { padding: 50px 0; }
}
