/* Courses page — ported from dawar lhony/Courses.html & Course Detail.html */

[dir="rtl"] .ph-title,
[dir="rtl"] .course-title,
[dir="rtl"] .lesson-title {
  line-height: 1.55;
  letter-spacing: 0;
}

/* ── PAGE HEADER ── */

.page-header { background: white; border-bottom: 1px solid var(--border, #e5e7eb); padding: 28px 0; }

.ph-inner { max-width: 1320px; margin: 0 auto; padding: 0 80px; display: flex; align-items: center; justify-content: space-between; gap: 40px; }

.ph-bc { font-size: 12.5px; color: var(--muted, #6b7280); display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }

.ph-bc a { color: var(--muted, #6b7280); text-decoration: none; transition: color .15s; }

.ph-bc a:hover { color: var(--orange, #fd8a00); }

.ph-title { font-size: 26px; font-weight: 800; letter-spacing: -0.6px; color: var(--text, #111827); margin-bottom: 5px; }

.ph-sub { font-size: 14px; color: var(--muted, #6b7280); line-height: 1.65; max-width: 500px; }

.ph-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; flex-shrink: 0; }

.ph-stat { background: var(--bg-alt, #f9fafb); border: 1.5px solid var(--border, #e5e7eb); border-radius: 14px; padding: 14px 18px; text-align: center; min-width: 90px; }

.ph-stat-num { font-size: 20px; font-weight: 800; color: var(--orange, #fd8a00); line-height: 1; }

.ph-stat-lbl { font-size: 11px; color: var(--muted, #6b7280); margin-top: 3px; font-weight: 600; }

/* ── FILTER BAR ── */

.filter-bar { background: white; border-bottom: 1px solid var(--border, #e5e7eb); position: sticky; top: 72px; z-index: 100; }

.filter-inner { max-width: 1320px; margin: 0 auto; padding: 0 80px; display: flex; align-items: center; gap: 8px; height: 64px; overflow-x: auto; scrollbar-width: none; }

.filter-inner::-webkit-scrollbar { display: none; }

.f-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 18px; border-radius: 100px; border: 1.5px solid var(--border, #e5e7eb); background: white; font-size: 13.5px; font-weight: 600; color: var(--muted, #6b7280); cursor: pointer; transition: all .18s; white-space: nowrap; font-family: inherit; flex-shrink: 0; }

.f-pill:hover { border-color: var(--orange, #fd8a00); color: var(--orange, #fd8a00); background: var(--ol, #fff4e6); }

.f-pill.active { background: var(--orange, #fd8a00); border-color: var(--orange, #fd8a00); color: white; }

.f-pill .cnt { background: rgba(0,0,0,0.1); border-radius: 100px; padding: 1px 7px; font-size: 11px; font-weight: 700; }

.f-pill.active .cnt { background: rgba(255,255,255,0.25); }

/* ── COURSES GRID ── */

.courses-section { padding: 64px 0 100px; }

.courses-inner { max-width: 1320px; margin: 0 auto; padding: 0 80px; }

.courses-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

.course-card {
  background: white; border: 1px solid var(--border, #e5e7eb); border-radius: 20px;
  overflow: hidden; text-decoration: none; display: flex; flex-direction: column;
  cursor: pointer; transition: transform .25s, box-shadow .25s; color: inherit;
}

.course-card:hover { transform: translateY(-6px); box-shadow: 0 20px 56px rgba(0,0,0,0.1); }

.course-card.is-hidden { display: none; }

.course-thumb { position: relative; height: 200px; overflow: hidden; background-size: cover; background-position: center; }

.course-thumb img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; display: block; transition: transform .4s; }

.course-card:hover .course-thumb img { transform: scale(1.05); }

.course-thumb-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.5) 100%); }

.course-badge { position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2; background: var(--orange, #fd8a00); color: white; font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 100px; letter-spacing: 0.3px; }

.course-badge.free { background: var(--green, #16a34a); }

.course-cat { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2; background: rgba(0,0,0,0.55); backdrop-filter: blur(8px); color: white; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 100px; }

.course-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }

.course-title { font-size: 17px; font-weight: 800; color: var(--text, #111827); line-height: 1.3; margin-bottom: 8px; letter-spacing: -0.3px; }

.course-desc { font-size: 13.5px; color: var(--muted, #6b7280); line-height: 1.65; margin-bottom: 16px; flex: 1; }

.course-stats { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }

.course-stat { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted, #6b7280); font-weight: 600; }

.course-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--border, #e5e7eb); }

.course-price { font-size: 22px; font-weight: 800; color: var(--orange, #fd8a00); letter-spacing: -0.5px; }

.course-price.free { color: var(--green, #16a34a); }

.course-enroll-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; background: var(--orange, #fd8a00); color: white; font-size: 13px; font-weight: 700; border-radius: 9px; transition: background .18s, transform .15s; }

.course-card:hover .course-enroll-btn { background: var(--oh, #e07a00); transform: translateY(-1px); }

/* ── COURSE DETAIL / LMS ── */

.lms-wrap { max-width: 1400px; margin: 0 auto; padding: 24px 32px 80px; display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; }

.lms-sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 80px; }

.enroll-card { border: 1px solid var(--border, #e5e7eb); border-radius: 20px; overflow: hidden; background: white; }

.enroll-thumb { height: 160px; overflow: hidden; position: relative; background-size: cover; background-position: center; }

.enroll-thumb img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }

.enroll-body { padding: 20px; }

.enroll-price { font-size: 30px; font-weight: 800; color: var(--orange, #fd8a00); letter-spacing: -1px; margin-bottom: 4px; }

.enroll-price.free { color: var(--green, #16a34a); }

.enroll-price-sub { font-size: 12px; color: var(--muted, #6b7280); margin-bottom: 18px; }

.enroll-big-btn { width: 100%; padding: 15px; background: var(--orange, #fd8a00); color: white; font-size: 15px; font-weight: 700; border: none; border-radius: 12px; cursor: pointer; font-family: inherit; transition: background .18s, transform .15s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; text-decoration: none; }

.enroll-big-btn:hover { background: var(--oh, #e07a00); transform: translateY(-1px); }

.enroll-big-btn.enrolled { background: var(--green, #16a34a); }

.enroll-big-btn.enrolled:hover { background: #15803d; }

.enroll-free-status { margin: 0; padding: 10px 0 2px; font-size: 13px; font-weight: 700; color: var(--green, #16a34a); text-align: center; }

.enroll-features { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border, #e5e7eb); }

.enroll-feat { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted, #6b7280); }

.enroll-feat svg { flex-shrink: 0; color: var(--orange, #fd8a00); }

.prog-card { background: var(--bg-alt, #f9fafb); border: 1px solid var(--border, #e5e7eb); border-radius: 18px; padding: 18px; display: flex; align-items: center; gap: 16px; }

.prog-ring-wrap { position: relative; flex-shrink: 0; width: 64px; height: 64px; }

.prog-ring-track { fill: none; stroke: var(--border, #e5e7eb); stroke-width: 6; }

.prog-ring-fill { fill: none; stroke: var(--orange, #fd8a00); stroke-width: 6; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .5s ease; }

.prog-pct-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: var(--text, #111827); }

.prog-label { font-size: 13px; font-weight: 700; color: var(--text, #111827); margin-bottom: 3px; }

.prog-sub { font-size: 12px; color: var(--muted, #6b7280); }

.curriculum { background: white; border: 1px solid var(--border, #e5e7eb); border-radius: 20px; overflow: hidden; }

.curriculum-hd { padding: 16px 20px; border-bottom: 1px solid var(--border, #e5e7eb); display: flex; align-items: center; justify-content: space-between; }

.curriculum-hd-title { font-size: 15px; font-weight: 800; color: var(--text, #111827); }

.curriculum-hd-meta { font-size: 12px; color: var(--muted, #6b7280); }

.c-part { border-bottom: 1px solid var(--border, #e5e7eb); }

.c-part:last-child { border-bottom: none; }

.c-part-hd { padding: 13px 20px; display: flex; align-items: center; gap: 10px; cursor: pointer; background: var(--bg-alt, #f9fafb); transition: background .15s; border: none; width: 100%; text-align: inherit; font-family: inherit; }

.c-part-hd:hover { background: #f3f4f6; }

.c-part-arrow { transition: transform .22s; color: var(--muted, #6b7280); flex-shrink: 0; }

.c-part.open .c-part-arrow { transform: rotate(90deg); }

.c-part-name { font-size: 13px; font-weight: 700; color: var(--text, #111827); flex: 1; }

.c-part-cnt { font-size: 11.5px; color: var(--muted, #6b7280); white-space: nowrap; }

.c-lessons { max-height: 0; overflow: hidden; transition: max-height .3s ease; }

.c-part.open .c-lessons { max-height: 1200px; }

.c-lesson { display: flex; align-items: center; gap: 10px; padding: 11px 20px 11px 28px; cursor: pointer; transition: background .15s; border-top: 1px solid rgba(0,0,0,0.04); border: none; width: 100%; text-align: inherit; font-family: inherit; background: transparent; }

.c-lesson:hover { background: var(--ol, #fff4e6); }

.c-lesson.active { background: var(--ol, #fff4e6); }

.c-lesson.locked { cursor: default; opacity: 0.65; }

.c-lesson.locked:hover { background: transparent; }

.c-lesson-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.c-lesson-icon.play { background: var(--ol, #fff4e6); }

.c-lesson-icon.done { background: #f0fdf4; }

.c-lesson-icon.lock { background: var(--bg-alt, #f9fafb); }

.c-lesson-info { flex: 1; min-width: 0; text-align: start; }

.c-lesson-title { font-size: 12.5px; font-weight: 600; color: var(--text, #111827); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.c-lesson.active .c-lesson-title { color: var(--orange, #fd8a00); font-weight: 700; }

.c-lesson-dur { font-size: 11px; color: var(--muted, #6b7280); }

.free-pill { font-size: 10px; font-weight: 700; color: var(--green, #16a34a); background: #f0fdf4; border-radius: 4px; padding: 1px 6px; flex-shrink: 0; }

.video-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: var(--dark, #0d1b2a); border-radius: 16px; overflow: hidden; margin-bottom: 24px; }

.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.video-locked { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(13,27,42,0.92); color: white; text-align: center; padding: 24px; z-index: 2; }

.video-locked[hidden] { display: none !important; }

.prog-card[hidden] { display: none !important; }

.lock-icon { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }

.lock-text { font-size: 18px; font-weight: 800; }

.lock-sub { font-size: 13px; color: rgba(255,255,255,0.55); max-width: 320px; }

.lock-btn { padding: 12px 22px; background: var(--orange, #fd8a00); color: white; font-size: 14px; font-weight: 700; border: none; border-radius: 10px; cursor: pointer; font-family: inherit; text-decoration: none; }

.lesson-info { margin-bottom: 28px; }

.lesson-part { font-size: 11px; font-weight: 800; color: var(--orange, #fd8a00); letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 8px; }

.lesson-title { font-size: 24px; font-weight: 800; color: var(--text, #111827); line-height: 1.3; margin-bottom: 10px; }

.lesson-desc { font-size: 14px; color: var(--muted, #6b7280); line-height: 1.75; margin-bottom: 16px; }

.mark-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1.5px solid var(--border, #e5e7eb); border-radius: 10px; background: white; font-size: 13px; font-weight: 700; color: var(--text, #111827); cursor: pointer; font-family: inherit; transition: all .18s; }

.mark-btn:hover { border-color: var(--orange, #fd8a00); color: var(--orange, #fd8a00); background: var(--ol, #fff4e6); }

.mark-btn.done { border-color: var(--green, #16a34a); color: var(--green, #16a34a); background: #f0fdf4; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border, #e5e7eb); margin-bottom: 24px; }

.tab-btn { padding: 12px 18px; border: none; background: none; font-size: 14px; font-weight: 700; color: var(--muted, #6b7280); cursor: pointer; font-family: inherit; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .18s, border-color .18s; }

.tab-btn.active { color: var(--orange, #fd8a00); border-bottom-color: var(--orange, #fd8a00); }

.tab-pane { display: none; }

.tab-pane.active { display: block; }

.overview-desc { font-size: 15px; color: var(--muted, #6b7280); line-height: 1.8; margin-bottom: 24px; }

.learn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.learn-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text, #111827); line-height: 1.5; }

.learn-check { width: 20px; height: 20px; border-radius: 50%; background: #f0fdf4; color: var(--green, #16a34a); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }

.res-list { display: flex; flex-direction: column; gap: 10px; }

.res-item { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; text-decoration: none; color: inherit; transition: border-color .18s, background .18s; cursor: pointer; }

.res-item:hover { border-color: var(--orange, #fd8a00); background: var(--ol, #fff4e6); }

.res-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--bg-alt, #f9fafb); color: var(--orange, #fd8a00); }

.res-name { font-size: 14px; font-weight: 700; color: var(--text, #111827); }

.res-meta { font-size: 12px; color: var(--muted, #6b7280); margin-top: 2px; }

.quiz-locked-msg { text-align: center; padding: 40px 24px; background: var(--bg-alt, #f9fafb); border: 1px dashed var(--border, #e5e7eb); border-radius: 16px; }

.quiz-locked-icon { font-size: 32px; margin-bottom: 12px; }

.quiz-locked-title { font-size: 17px; font-weight: 800; margin-bottom: 8px; }

.quiz-locked-sub { font-size: 13px; color: var(--muted, #6b7280); line-height: 1.65; max-width: 420px; margin: 0 auto 16px; }

.quiz-progress-wrap { height: 6px; background: var(--border, #e5e7eb); border-radius: 3px; overflow: hidden; max-width: 280px; margin: 0 auto 8px; }

.quiz-progress-bar { height: 100%; background: var(--orange, #fd8a00); border-radius: 3px; transition: width .4s; }

.quiz-progress-txt { font-size: 12px; color: var(--muted, #6b7280); }

.quiz-q { margin-bottom: 22px; padding: 18px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; }

.quiz-q-text { font-size: 14px; font-weight: 700; margin-bottom: 12px; }

.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; transition: background .15s; }

.quiz-opt:hover { background: var(--bg-alt, #f9fafb); }

.quiz-opt input { accent-color: var(--orange, #fd8a00); }

.quiz-submit { margin-top: 8px; padding: 13px 24px; background: var(--orange, #fd8a00); color: white; font-size: 14px; font-weight: 700; border: none; border-radius: 10px; cursor: pointer; font-family: inherit; }

.quiz-submit:disabled { opacity: 0.45; cursor: not-allowed; }

.quiz-result { margin-top: 20px; padding: 20px; border-radius: 14px; background: #f0fdf4; border: 1px solid rgba(22,163,74,0.2); text-align: center; }

.quiz-result.fail { background: #fef2f2; border-color: rgba(220,38,38,0.2); }

@media (max-width: 1024px) {
  .ph-inner, .filter-inner, .courses-inner { padding-inline: 28px; }
  .ph-stats { grid-template-columns: repeat(2, 1fr); }
  .lms-wrap { grid-template-columns: 1fr; padding-inline: 28px; }
  .lms-sidebar { position: static; }
}

@media (max-width: 900px) {
  .courses-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .page-header { padding: 20px 0; }
  .ph-inner { flex-direction: column; align-items: flex-start; gap: 18px; padding-inline: 20px; }
  .ph-title { font-size: 22px; }
  .ph-stats { width: 100%; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .ph-stat { padding: 12px 10px; min-width: 0; }
  .filter-inner, .courses-inner { padding-inline: 20px; }
  .courses-section { padding: 48px 0 72px; }
  .lms-wrap { padding: 12px 20px 60px; gap: 20px; }
  .learn-grid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .courses-grid { grid-template-columns: 1fr; }
  .ph-stat-num { font-size: 17px; }
  .ph-stat-lbl { font-size: 10px; }
}
