/*
   Courses and learning paths.
   The lp-* rules are the design's learning-paths.html inline <style>, ported as-is so the pages match
   the design; the blocks after them cover what the design left to inline styles or did not have
   (wishlist heart states, extra colour themes, server-rendered step states).
   Loaded only by Views/Courses/*.
*/

/* ===== LEARNING PATHS PAGE ===== */

/* HERO */
.lp-hero {
  background: linear-gradient(135deg, #01060b 0%, #0d2418 40%, #1a6651 100%);
  padding: 3.5rem 0 4rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.lp-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(46,184,114,.1);
  pointer-events: none;
}
.lp-hero::after {
  content: '';
  position: absolute;
  bottom: -80px; left: 8%;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(230,184,92,.07);
  pointer-events: none;
}
.lp-hero-stat {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: .75rem;
  padding: .75rem 1.25rem;
  text-align: center;
  min-width: 90px;
}
.lp-hero-stat .stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e6b85c;
  line-height: 1;
}
.lp-hero-stat .stat-lbl {
  font-size: .72rem;
  color: rgba(255,255,255,.65);
  margin-top: 3px;
}
.lp-hero-icon-wrap {
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem;
  color: rgba(230,184,92,.8);
}

/* FILTER BAR */
.lp-filter-wrap {
  background: var(--bg-white-ip, #fff);
  border-bottom: 1px solid rgba(0,0,0,.07);
  position: sticky;
  top: 56px;
  z-index: 99;
  padding: .65rem 0;
}
.lp-filter-btn {
  border: 1.5px solid #dee2e6;
  background: transparent;
  border-radius: 2rem;
  padding: .38rem 1.1rem;
  font-size: .84rem;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.lp-filter-btn:hover, .lp-filter-btn.active {
  background: #1f7a63;
  border-color: #1f7a63;
  color: #fff;
}

/* PATH CARDS */
.lp-path-card {
  border-radius: 1rem;
  overflow: hidden;
  border: 1.5px solid transparent;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  transition: transform .22s, box-shadow .22s, border-color .22s;
  cursor: pointer;
  background: var(--bg-white-ip, #fff);
  display: flex; flex-direction: column;
}
.lp-path-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,.13);
}
.lp-path-card.lp-selected {
  border-color: #1f7a63;
  box-shadow: 0 0 0 3px rgba(31,122,99,.15);
}
.lp-card-head {
  padding: 1.5rem 1.5rem 1.1rem;
}
.lp-card-icon {
  width: 50px; height: 50px;
  border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  background: rgba(255,255,255,.18);
  margin-bottom: .75rem;
}
.lp-card-body { padding: 0 1.5rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.lp-level-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .18rem .6rem;
  border-radius: 2rem;
}
.lp-level-badge.beginner    { background: #d1fae5; color: #065f46; }
.lp-level-badge.intermediate { background: #dbeafe; color: #1e40af; }
.lp-level-badge.advanced    { background: #ede9fe; color: #5b21b6; }

.lp-prog-bar { height: 6px; background: #e9ecef; border-radius: 99px; overflow: hidden; margin-top: .4rem; }
.lp-prog-fill { height: 100%; background: linear-gradient(90deg, #1f7a63, #2eb872); border-radius: 99px; transition: width .4s; }
.lp-path-stat { display: flex; align-items: center; gap: .3rem; font-size: .79rem; color: #888; }

/* HEADER COLORS */
.lp-green  { background: linear-gradient(135deg, #1f7a63, #2eb872); }
.lp-blue   { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.lp-purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.lp-orange { background: linear-gradient(135deg, #d97706, #f59e0b); }

/* DETAIL SECTION */
.lp-detail-wrap {
  background: var(--bg-light-theme, #f5f5f5);
  border-top: 3px solid #1f7a63;
  padding: 2.5rem 0 3rem;
}
.lp-detail-prog-bar { height: 10px; background: #e9ecef; border-radius: 99px; overflow: hidden; }
.lp-detail-prog-fill { height: 100%; background: linear-gradient(90deg, #1f7a63, #2eb872); border-radius: 99px; transition: width .5s; }

/* STEPS */
.lp-steps-list { position: relative; }
.lp-steps-list::before {
  content: '';
  position: absolute;
  left: 21px; top: 0; bottom: 0;
  width: 2px;
  background: #e9ecef;
  z-index: 0;
}
.lp-step-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: .875rem;
  border: 1.5px solid #e9ecef;
  background: var(--bg-white-ip, #fff);
  margin-bottom: .75rem;
  position: relative;
  z-index: 1;
  transition: border-color .2s, box-shadow .2s;
}
.lp-step-item.s-done   { border-color: #d1fae5; background: #f0fdf4; }
.lp-step-item.s-active { border-color: #1f7a63; box-shadow: 0 0 0 3px rgba(31,122,99,.1); }
.lp-step-item.s-locked { opacity: .55; }
.lp-step-num {
  width: 44px; height: 44px; min-width: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700;
  flex-shrink: 0; transition: all .2s;
  background: #e9ecef; color: #999;
}
.s-done   .lp-step-num { background: #1f7a63; color: #fff; }
.s-active .lp-step-num { background: #1f7a63; color: #fff; box-shadow: 0 0 0 4px rgba(31,122,99,.2); }
.lp-step-body { flex: 1; min-width: 0; }
.lp-step-title { font-weight: 600; font-size: .95rem; margin-bottom: .2rem; }
.lp-step-desc  { font-size: .82rem; color: #777; margin-bottom: .55rem; line-height: 1.5; }
.lp-step-time  { font-size: .76rem; color: #888; display: flex; align-items: center; gap: .25rem; }

/* SUMMARY CARD */
.lp-summary-card {
  background: var(--bg-white-ip, #fff);
  border-radius: 1rem;
  overflow: hidden;
  border: 1.5px solid #e9ecef;
  position: sticky; top: 80px;
}
.lp-summary-head { padding: 1.25rem 1.5rem; }
.lp-summary-body { padding: 1.25rem 1.5rem; }
.lp-cert-box {
  background: linear-gradient(135deg, #fef9ee, #fdf3d0);
  border: 1px solid #e6b85c;
  border-radius: .75rem;
  padding: 1rem;
  text-align: center;
}

/* Dark mode */
body.dark .lp-path-card { background: #1a2330; border-color: rgba(255,255,255,.07); }
body.dark .lp-path-card.lp-selected { border-color: #1f7a63; }
body.dark .lp-filter-wrap { background: #12202e; border-color: rgba(255,255,255,.07); }
body.dark .lp-filter-btn  { border-color: rgba(255,255,255,.15); color: #bbb; }
body.dark .lp-detail-wrap { background: #0f1923; }
body.dark .lp-step-item   { background: #1a2330; border-color: rgba(255,255,255,.08); }
body.dark .lp-step-item.s-done  { background: #0d2b1e; border-color: rgba(31,122,99,.35); }
body.dark .lp-step-item.s-active { background: #1a2330; border-color: #1f7a63; }
body.dark .lp-step-num    { background: #2a3a4a; color: #666; }
body.dark .s-done   .lp-step-num, body.dark .s-active .lp-step-num { background: #1f7a63; color: #fff; }
body.dark .lp-steps-list::before { background: rgba(255,255,255,.08); }
body.dark .lp-prog-bar, body.dark .lp-detail-prog-bar { background: #2a3a4a; }
body.dark .lp-summary-card { background: #1a2330; border-color: rgba(255,255,255,.1); }
body.dark .lp-step-desc   { color: #999; }
body.dark .lp-cert-box    { background: linear-gradient(135deg, #2a1f05, #2a1a00); border-color: #7a5c1e; }

/* ===== ADDITIONS TO THE DESIGN ===== */

/* More header colours an administrator may type into a path's Colour Theme. */
.lp-red    { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.lp-teal   { background: linear-gradient(135deg, #0f766e, #14b8a6); }

/* The hero sits on a dark gradient, so its breadcrumb needs light text. */
.lp-hero .islamicBread .breadcrumb-item,
.lp-hero .islamicBread .breadcrumb-item a,
.lp-hero .islamicBread .breadcrumb-item::before { color: rgba(255,255,255,.7); }
.lp-hero .islamicBread .breadcrumb-item a:hover { color: #fff; }
.lp-hero .islamicBread .breadcrumb-item.active { color: #e6b85c; }
.lp-hero .container { position: relative; z-index: 1; }
.lp-hero-title { font-size: 2.4rem; }
.lp-hero-text  { font-size: 1.1rem; opacity: .8; max-width: 520px; }
.lp-hero-badge { background: #1f7a63 !important; font-size: .8rem; }

/* Path cards are links to the path's own page. */
a.lp-path-card { text-decoration: none; color: inherit; }
.lp-card-title    { font-size: 1.05rem; }
.lp-card-subtitle { font-size: .78rem; color: rgba(255,255,255,.75); }
.lp-card-btn      { border-radius: .65rem; }
.lp-detail-icon   { width: 56px; height: 56px; border-radius: .875rem; font-size: 1.5rem; flex-shrink: 0; margin-bottom: 0; }

/* Step states are classes on server-rendered markup; the script only swaps them. */
.lp-step-title i { color: #1f7a63; margin-right: .35rem; }
.lp-step-item.s-done .lp-step-title-text { text-decoration: line-through; opacity: .55; }
.lp-step-item.s-locked .lp-step-title i { color: #9ca3af; }
.lp-badge-done   { background: #d1fae5; color: #065f46; }
.lp-badge-next   { background: #e6f4ef; color: #1f7a63; font-weight: 600; }
.lp-badge-locked { background: #f3f4f6; color: #9ca3af; }
.lp-cert-box .lp-cert-icon  { font-size: 2rem; color: #d97706; }
.lp-cert-box .lp-cert-title { color: #92400e; font-size: .85rem; }
.lp-cert-box .lp-cert-text  { font-size: .75rem; }
.lp-completed-box {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #6ee7b7;
  border-radius: .875rem;
  padding: 1.25rem;
  text-align: center;
}
.lp-completed-box i { font-size: 2rem; color: #059669; }
body.dark .lp-completed-box { background: linear-gradient(135deg, #0d2b1e, #0f3526); border-color: rgba(31,122,99,.5); }
body.dark .lp-badge-locked { background: #2a3a4a; color: #8b9aab; }

/* ===== COURSES ===== */

/* Saved state of the heart on a course card, and of the "Add to list" button. */
.wishlist_btn.active { background: #dc2626; color: #fff; }
.wishlist_btn.is-busy,
.course-wishlist-toggle.is-busy { opacity: .6; pointer-events: none; }
.course_thumb > a { display: block; height: 100%; }

.course-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #12202e;
  color: #fff;
  padding: .6rem 1.1rem;
  border-radius: 2rem;
  font-size: .85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 1080;
  max-width: calc(100vw - 32px);
}
.course-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.course-toast a { color: #6ee7b7; font-weight: 600; margin-left: .5rem; }

.courseSidebar.sticky-top { z-index: 1; }
.enroll_card > img { max-height: 200px; }
.instructor_bio p:last-child { margin-bottom: 0; }
body.dark .lecture_item:hover { background: rgba(255,255,255,.04); }

/* Bootstrap's display utilities are !important, so the hidden attribute needs the same weight here. */
.lp-detail-wrap [hidden],
#lpGrid [hidden],
#courseAccordion [hidden] { display: none !important; }
