/* ============================================================
   Qalam Education Platform - Course Details Stylesheet
   Theme: Qalam Teal (#16a39a) & Deep Navy (#15374e)
   Direction: RTL (Arabic)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
  --cd-teal: #16a39a;
  --cd-teal-dark: #118078;
  --cd-teal-light: #1ec7bb;
  --cd-teal-soft: #e0f7f5;
  --cd-teal-bg: #f0fbf9;
  --cd-navy: #15374e;
  --cd-navy-dark: #0d2131;
  --cd-text: #1e293b;
  --cd-muted: #64748b;
  --cd-border: #e2e8f0;
  --cd-card-bg: #ffffff;
  --cd-font: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
  --cd-radius-lg: 20px;
  --cd-radius-md: 14px;
  --cd-radius-sm: 8px;
  --cd-radius-full: 50px;
  --cd-shadow-sm: 0 2px 8px rgba(21, 55, 78, 0.04);
  --cd-shadow-md: 0 8px 24px rgba(21, 55, 78, 0.06);
  --cd-shadow-lg: 0 14px 35px rgba(22, 163, 154, 0.12);
}

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

body.cd-page-body {
  font-family: var(--cd-font);
  background-color: #fcfdfd;
  color: var(--cd-text);
  direction: rtl;
  text-align: right;
  margin: 0;
  padding: 0;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Navbar
   ============================================================ */
.cd-navbar {
  background: #ffffff;
  border-bottom: 1px solid #edf2f7;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.03);
}

.cd-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cd-brand-logo {
  height: 42px;
  width: auto;
  display: block;
}

.cd-nav-menu {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cd-nav-link {
  color: #334155;
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  transition: color 0.25s ease;
  position: relative;
  padding: 4px 0;
}

.cd-nav-link:hover,
.cd-nav-link.active {
  color: var(--cd-teal);
  font-weight: 700;
}

.cd-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  left: 0;
  height: 2.5px;
  background: var(--cd-teal);
  border-radius: 2px;
}

.cd-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 220px;
}

.cd-search-input {
  width: 100%;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: var(--cd-radius-full);
  padding: 8px 36px 8px 16px;
  font-size: 0.86rem;
  font-family: inherit;
  color: var(--cd-text);
  outline: none;
  transition: all 0.25s ease;
}

.cd-search-input:focus {
  background: #ffffff;
  border-color: var(--cd-teal);
  box-shadow: 0 0 0 3px rgba(22, 163, 154, 0.15);
}

.cd-search-icon {
  position: absolute;
  right: 14px;
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
}

.cd-auth-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-cd-login {
  color: var(--cd-navy);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 7px 18px;
  border-radius: var(--cd-radius-full);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.btn-cd-login:hover {
  color: var(--cd-teal);
  background: rgba(22, 163, 154, 0.06);
}

.btn-cd-register {
  background: var(--cd-teal);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 7px 22px;
  border-radius: var(--cd-radius-full);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(22, 163, 154, 0.25);
  transition: all 0.25s ease;
}

.btn-cd-register:hover {
  background: var(--cd-teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(22, 163, 154, 0.35);
}

/* Mobile Nav Toggler */
.cd-mobile-toggler {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--cd-navy);
  cursor: pointer;
  padding: 4px;
}

.cd-mobile-search-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--cd-navy);
  cursor: pointer;
  padding: 4px;
}

/* ============================================================
   Breadcrumbs
   ============================================================ */
.cd-breadcrumbs {
  padding: 12px 0 6px;
  font-size: 0.76rem;
  color: var(--cd-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cd-breadcrumbs a {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.cd-breadcrumbs a:hover {
  color: var(--cd-teal);
}

.cd-breadcrumbs .cd-sep {
  font-size: 0.65rem;
  color: #94a3b8;
  margin: 0 2px;
}

.cd-breadcrumbs .cd-current {
  color: var(--cd-navy);
  font-weight: 700;
}

/* ============================================================
   Hero Section (Course Details Top)
   ============================================================ */
.cd-hero-section {
  padding: 24px 0 32px;
  position: relative;
}

.cd-hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: center;
}

/* Right Column (Info) */
.cd-hero-info {
  display: flex;
  flex-direction: column;
}

.cd-cat-badge {
  display: inline-flex;
  align-items: center;
  background: #e0f7f5;
  color: var(--cd-teal);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: var(--cd-radius-full);
  align-self: flex-start;
  margin-bottom: 12px;
  border: 1px solid rgba(22, 163, 154, 0.2);
}

.cd-hero-title {
  color: var(--cd-navy);
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 6px;
}

.cd-hero-subtitle {
  color: var(--cd-navy);
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.cd-hero-desc {
  color: var(--cd-muted);
  font-size: 0.94rem;
  line-height: 1.7;
  margin-bottom: 18px;
  max-width: 620px;
}

/* Instructor Row */
.cd-instructor-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.cd-instructor-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.cd-instructor-info {
  display: flex;
  flex-direction: column;
}

.cd-instructor-label {
  font-size: 0.76rem;
  color: #94a3b8;
  font-weight: 500;
  line-height: 1.2;
}

.cd-instructor-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--cd-navy);
  line-height: 1.3;
}

/* Stats Horizontal Bar */
.cd-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: var(--cd-radius-md);
  padding: 12px 20px;
  margin-bottom: 24px;
  box-shadow: var(--cd-shadow-sm);
  max-width: 640px;
}

.cd-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cd-stat-icon {
  color: var(--cd-teal);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
}

.cd-stat-icon.star {
  color: #f59e0b;
}

.cd-stat-text {
  display: flex;
  flex-direction: column;
}

.cd-stat-val {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--cd-navy);
  line-height: 1.2;
}

.cd-stat-lbl {
  font-size: 0.74rem;
  color: var(--cd-muted);
  font-weight: 600;
  line-height: 1.2;
}

.cd-stat-divider {
  width: 1px;
  height: 28px;
  background: #f1f5f9;
}

/* Action Buttons Row */
.cd-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-cd-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cd-teal);
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.98rem;
  padding: 10px 30px;
  border-radius: var(--cd-radius-full);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(22, 163, 154, 0.32);
  transition: all 0.3s ease;
  border: none;
}

.btn-cd-primary:hover {
  background: var(--cd-teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22, 163, 154, 0.42);
}

.btn-cd-primary i {
  font-size: 1.05rem;
  transition: transform 0.25s ease;
}

.btn-cd-primary:hover i {
  transform: translateX(-3px);
}

.btn-cd-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--cd-navy) !important;
  border: 1.5px solid var(--cd-teal);
  font-weight: 700;
  font-size: 0.96rem;
  padding: 9px 24px;
  border-radius: var(--cd-radius-full);
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-cd-outline:hover {
  background: var(--cd-teal-soft);
  color: var(--cd-teal-dark) !important;
}

.btn-cd-outline i {
  color: var(--cd-teal);
  font-size: 1.05rem;
}

.btn-cd-fav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--cd-navy) !important;
  border: 1.5px solid #cbd5e1;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 9px 20px;
  border-radius: var(--cd-radius-full);
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-cd-fav:hover {
  border-color: #ef4444;
  color: #ef4444 !important;
}

.btn-cd-fav.active {
  border-color: #ef4444;
  background: #fef2f2;
  color: #ef4444 !important;
}

.btn-cd-fav.active i {
  color: #ef4444;
}

/* Banner Cards */
.cd-banner-card {
  position: relative;
  border-radius: var(--cd-radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(22, 163, 154, 0.14), 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(22, 163, 154, 0.2);
  background: #ffffff;
  transition: transform 0.35s ease;
}

.cd-banner-desktop {
  width: 340px;
  max-width: 100%;
}

.cd-banner-card:hover {
  transform: translateY(-4px);
}

.cd-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ============================================================
   Main Layout: Content & Sidebar
   ============================================================ */
.cd-main-section {
  padding: 20px 0 60px;
}

.cd-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

/* Main Content Area */
.cd-content-area {
  display: flex;
  flex-direction: column;
}

.cd-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cd-content-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cd-content-title-icon {
  color: var(--cd-teal);
  font-size: 1.5rem;
}

.cd-content-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--cd-navy);
  margin: 0;
}

.btn-cd-toggle-all {
  background: none;
  border: none;
  color: var(--cd-teal);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--cd-radius-full);
  transition: background 0.2s;
}

.btn-cd-toggle-all:hover {
  background: var(--cd-teal-soft);
}

/* ============================================================
   Mobile Only Meta Cards (Requirements & Target Audience)
   ============================================================ */
.cd-mobile-meta-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.cd-mobile-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e5eaf0;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.cd-mobile-card-row:active {
  transform: scale(0.99);
}

.cd-mobile-card-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cd-mobile-card-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(22, 163, 154, 0.08);
  color: var(--cd-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.cd-mobile-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cd-mobile-card-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--cd-navy);
}

.cd-mobile-card-sub {
  font-size: 0.76rem;
  color: var(--cd-muted);
  font-weight: 500;
}

.cd-mobile-card-arrow {
  font-size: 0.82rem;
  color: #94a3b8;
}

/* Accordion Modules */
.cd-accordion-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cd-module-item {
  background: #ffffff;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-md);
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: var(--cd-shadow-sm);
}

.cd-module-item.open {
  border-color: rgba(22, 163, 154, 0.35);
  box-shadow: 0 4px 18px rgba(22, 163, 154, 0.08);
}

.cd-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  background: #ffffff;
  transition: background 0.2s;
}

.cd-module-header:hover {
  background: #f8fafc;
}

.cd-module-title-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cd-module-num {
  font-size: 1rem;
  font-weight: 800;
  color: var(--cd-navy);
}

.cd-module-meta-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cd-module-count {
  font-size: 0.84rem;
  color: var(--cd-muted);
  font-weight: 600;
}

.cd-module-chevron {
  color: var(--cd-navy);
  font-size: 0.85rem;
  transition: transform 0.3s ease;
}

.cd-module-item.open .cd-module-chevron {
  transform: rotate(180deg);
  color: var(--cd-teal);
}

/* Lessons List */
.cd-lessons-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  background: #fcfdfd;
}

.cd-module-item.open .cd-lessons-body {
  max-height: 500px;
}

.cd-lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 12px 24px;
  border-top: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.cd-lesson-row:hover {
  background: #f8fafc;
}

.cd-lesson-title-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cd-lesson-icon {
  color: var(--cd-muted);
  font-size: 1.05rem;
}

.cd-lesson-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

.cd-lesson-meta-side {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.btn-cd-lesson-preview {
  background: transparent;
  border: none;
  padding: 2px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
  user-select: none;
  border-radius: 6px;
}

.btn-cd-lesson-preview:hover {
  background-color: rgba(107, 33, 168, 0.06);
}

.btn-cd-lesson-preview .cd-preview-text {
  color: #6b21a8;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
  line-height: 1;
}

.btn-cd-lesson-preview:hover .cd-preview-text {
  color: #581c87;
}

.btn-cd-lesson-preview .cd-preview-play-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #1c1d1f;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  padding-right: 1px;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.btn-cd-lesson-preview:hover .cd-preview-play-icon {
  transform: scale(1.14);
  background-color: #000000;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.btn-cd-lesson-preview:active {
  transform: scale(0.97);
}

.cd-lesson-duration {
  font-size: 0.82rem;
  color: var(--cd-muted);
  font-weight: 600;
  white-space: nowrap;
}


/* ============================================================
   Calm Minimalist Sidebar with Collapsible Sections
   ============================================================ */
.cd-sidebar-wrap {
  width: 100%;
  position: sticky;
  top: 90px;
  align-self: flex-start;
  flex-direction: column;
}

.cd-sidebar-card {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 18px;
  padding: 24px 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Top Specs List */
.cd-sidebar-specs {
  display: flex;
  flex-direction: column;
}

.cd-spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.cd-spec-row.no-border {
  border-bottom: none;
  padding-bottom: 4px;
}

.cd-spec-key {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 600;
}

.cd-spec-key i {
  color: var(--cd-teal);
  font-size: 1.15rem;
  width: 20px;
  text-align: center;
}

.cd-spec-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cd-navy);
}

/* Collapsible Sections */
.cd-side-collapsible {
  border-top: 1px solid #edf2f7;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
}

.cd-side-collapsible:first-child {
  border-top: none;
  padding-top: 0;
}

.cd-side-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  text-align: right;
  transition: opacity 0.2s;
}

.cd-side-toggle:hover {
  opacity: 0.85;
}

.cd-side-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cd-side-title-icon {
  color: var(--cd-teal);
  font-size: 1.25rem;
}

.cd-side-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--cd-navy);
  margin: 0;
  line-height: 1.3;
}

.cd-side-chevron {
  color: #64748b;
  font-size: 0.85rem;
  transition: transform 0.25s ease, color 0.2s ease;
}

.cd-side-toggle:hover .cd-side-chevron {
  color: var(--cd-teal);
}

/* Collapsible Body */
.cd-side-collapse-body {
  display: none;
  padding-top: 14px;
}

.cd-side-collapsible.open .cd-side-collapse-body {
  display: block;
}

/* Bullets */
.cd-side-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cd-side-bullets li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
}

.cd-side-bullets .cd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--cd-teal);
  flex-shrink: 0;
}

/* Mobile Inline Cards (Visible on mobile between hero and content) */
.cd-mobile-meta-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.cd-mobile-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius-md);
  padding: 14px 18px;
  box-shadow: var(--cd-shadow-sm);
  text-decoration: none;
  color: inherit;
}

.cd-mobile-card-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cd-mobile-card-icon {
  color: var(--cd-teal);
  font-size: 1.35rem;
}

.cd-mobile-card-text {
  display: flex;
  flex-direction: column;
}

.cd-mobile-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--cd-navy);
  line-height: 1.3;
}

.cd-mobile-card-sub {
  font-size: 0.78rem;
  color: var(--cd-muted);
  font-weight: 500;
}

.cd-mobile-card-arrow {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* ============================================================
   Pre-Footer CTA Banner
   ============================================================ */
.cd-prefooter-cta {
  background: linear-gradient(135deg, #e6f7f5 0%, #f0fbf9 50%, #e8f5f4 100%);
  border-radius: var(--cd-radius-lg);
  padding: 26px 36px;
  margin: 50px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(22, 163, 154, 0.22);
  box-shadow: 0 8px 24px rgba(22, 163, 154, 0.07);
  position: relative;
  overflow: hidden;
}

.cd-cta-bg-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cd-cta-dots-left {
  position: absolute;
  left: 20px;
  top: 15px;
  width: 90px;
  height: 50px;
  background-image: radial-gradient(rgba(22, 163, 154, 0.2) 1.5px, transparent 1.5px);
  background-size: 10px 10px;
}

.cd-cta-dots-right {
  position: absolute;
  right: 20px;
  bottom: 10px;
  width: 90px;
  height: 40px;
  background-image: radial-gradient(rgba(22, 163, 154, 0.2) 1.5px, transparent 1.5px);
  background-size: 10px 10px;
}

.cd-cta-info {
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1;
}

.cd-cta-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cd-teal);
  font-size: 1.45rem;
  box-shadow: 0 4px 14px rgba(22, 163, 154, 0.18);
  flex-shrink: 0;
}

.cd-cta-texts {
  display: flex;
  flex-direction: column;
}

.cd-cta-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--cd-navy);
  margin: 0;
  line-height: 1.3;
}

.cd-cta-sub {
  font-size: 0.88rem;
  color: var(--cd-muted);
  font-weight: 600;
  margin: 0;
}

.btn-cd-cta-enroll {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cd-teal);
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.98rem;
  padding: 11px 32px;
  border-radius: var(--cd-radius-full);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(22, 163, 154, 0.32);
  transition: all 0.3s ease;
  z-index: 1;
}

.btn-cd-cta-enroll:hover {
  background: var(--cd-teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22, 163, 154, 0.42);
}

.btn-cd-cta-enroll i {
  transition: transform 0.25s ease;
}

.btn-cd-cta-enroll:hover i {
  transform: translateX(-3px);
}

/* ============================================================
   Footer
   ============================================================ */
.cd-footer {
  background: #ffffff;
  border-top: 1px solid #edf2f7;
  padding: 35px 0 25px;
  margin-top: 30px;
}

.cd-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.cd-footer-logo {
  height: 42px;
  width: auto;
}

.cd-footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cd-footer-link {
  color: #475569;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.2s;
}

.cd-footer-link:hover {
  color: var(--cd-teal);
}

.cd-footer-socials {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cd-social-btn {
  color: #64748b;
  font-size: 1.15rem;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cd-social-btn:hover {
  color: var(--cd-teal);
  transform: translateY(-2px);
}

.cd-footer-bottom {
  border-top: 1px solid #f1f5f9;
  padding-top: 18px;
  text-align: center;
}

.cd-copyright-text {
  font-size: 0.84rem;
  color: #94a3b8;
  margin: 0;
}

/* ============================================================
   Responsive Breakdown
   ============================================================ */

/* Tablet & Smaller Laptops (< 1024px) */
@media (max-width: 1023px) {
  .cd-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .cd-banner-card {
    order: -1;
    max-width: 520px;
    margin: 0 auto;
  }

  .cd-main-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .cd-sidebar-wrap {
    order: -1;
    width: 100%;
    max-width: 100%;
    position: static;
  }

  .cd-content-area {
    order: 1;
    width: 100%;
  }
}

/* Mobile & Tablet (< 992px) */
@media (max-width: 991.98px) {
  .cd-main-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .cd-sidebar-wrap {
    order: -1; /* Appears first on mobile */
    width: 100%;
    max-width: 100%;
    position: static;
    margin-bottom: 6px;
  }

  .cd-content-area {
    order: 1; /* Appears after on mobile */
    width: 100%;
  }

  .cd-nav-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .cd-brand-wrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .cd-brand-logo {
    height: 38px;
  }

  .cd-mobile-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--cd-navy);
    font-size: 1.25rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
  }

  .cd-mobile-toggler {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--cd-navy);
    font-size: 1.55rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
  }
}

/* Mobile Devices (< 768px) */
@media (max-width: 767px) {
  .cd-hero-section {
    padding: 10px 0 24px;
  }

  /* Full-width mobile banner */
  .cd-banner-card {
    max-width: 100%;
    border-radius: var(--cd-radius-md);
    margin-bottom: 16px;
  }

  .cd-hero-title {
    font-size: 1.65rem;
  }

  .cd-hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }

  .cd-hero-desc {
    font-size: 0.86rem;
    line-height: 1.6;
    margin-bottom: 16px;
  }

  /* Compact 4-item stats grid on mobile */
  .cd-stats-mobile {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    padding: 12px 6px;
    gap: 0;
    text-align: center;
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
  }

  .cd-stats-mobile .cd-stat-item {
    position: relative;
    padding: 2px 4px;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
  }

  .cd-stats-mobile .cd-stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 1px;
    background: #eef2f6;
  }

  .cd-stat-icon {
    font-size: 1.05rem;
    justify-content: center;
  }

  .cd-stat-val {
    font-size: 0.8rem;
    font-weight: 800;
  }

  .cd-stat-lbl {
    font-size: 0.68rem;
    color: var(--cd-muted);
  }

  .cd-stat-divider {
    display: none;
  }

  /* Buttons on mobile */
  .cd-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .btn-cd-primary {
    flex: 2;
    padding: 10px 14px;
    font-size: 0.88rem;
    justify-content: center;
  }

  .btn-cd-outline {
    flex: 2;
    padding: 10px 12px;
    font-size: 0.88rem;
    justify-content: center;
  }

  .btn-cd-fav {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
  }

  /* Sidebar Card on mobile */
  .cd-sidebar-wrap {
    margin-bottom: 18px;
    width: 100%;
  }

  .cd-sidebar-card {
    padding: 16px 14px;
    border-radius: 16px;
    gap: 14px;
    width: 100%;
  }

  .cd-side-collapsible {
    padding-top: 12px;
  }

  .cd-side-title {
    font-size: 0.94rem;
  }

  .cd-side-title-icon {
    font-size: 1.15rem;
  }

  .cd-spec-row {
    padding: 8px 0;
  }

  .cd-spec-key {
    font-size: 0.84rem;
    gap: 8px;
  }

  .cd-spec-val {
    font-size: 0.84rem;
  }

  .cd-side-bullets li {
    font-size: 0.82rem;
  }

  /* Pre-footer CTA on mobile: Keep horizontal row matching reference */
  .cd-prefooter-cta {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 14px !important;
    gap: 8px !important;
    border-radius: 16px !important;
    text-align: right !important;
  }

  .cd-cta-info {
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .cd-cta-icon-wrap {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.15rem !important;
    flex-shrink: 0 !important;
  }

  .cd-cta-title {
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  .cd-cta-sub {
    font-size: 0.7rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  .btn-cd-cta-enroll {
    width: auto !important;
    padding: 7px 14px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* Footer on mobile */
  .cd-footer-top {
    flex-direction: column;
    gap: 18px;
    text-align: center;
  }

  .cd-footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
  }
}

/* ============================================================
   Course Banner Preview Overlay
   ============================================================ */
.cd-banner-card {
  position: relative;
  cursor: pointer;
}

.cd-banner-preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0.05) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0.95;
  transition: opacity 0.25s ease, background 0.25s ease;
  z-index: 2;
  user-select: none;
}

.cd-banner-card:hover .cd-banner-preview-overlay {
  opacity: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 60%, rgba(0, 0, 0, 0.15) 100%);
}

.cd-banner-play-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-color: #ffffff;
  color: #1c1d1f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  padding-right: 3px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background-color 0.2s ease;
}

.cd-banner-card:hover .cd-banner-play-circle {
  transform: scale(1.12);
  background-color: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.cd-banner-preview-badge {
  background-color: rgba(28, 29, 31, 0.88);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  letter-spacing: 0.2px;
}

/* ============================================================
   Course Preview Modal (معاينة الدورة) - Udemy Dark Theme Style
   ============================================================ */
html.cd-preview-modal-open,
body.cd-preview-modal-open {
  overflow: hidden !important;
}

.cd-preview-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(10, 15, 24, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: block;
  padding: 40px 16px 80px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #4b5563 rgba(15, 23, 42, 0.6);
}

.cd-preview-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Viewport-level scrollbar for the modal overlay (Udemy style) */
.cd-preview-modal-backdrop::-webkit-scrollbar {
  width: 10px;
}
.cd-preview-modal-backdrop::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.7);
}
.cd-preview-modal-backdrop::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 6px;
  border: 2px solid rgba(15, 23, 42, 0.7);
}
.cd-preview-modal-backdrop::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Modal Dialog: Takes full comfortable length across entire page scroll */
.cd-preview-modal-dialog {
  background-color: #1c1d1f;
  color: #ffffff;
  width: 100%;
  max-width: 590px;
  margin: 0 auto;
  height: auto;
  min-height: auto;
  max-height: none;
  border-radius: 12px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: visible;
  position: relative;
  transform: scale(0.97) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.cd-preview-modal-backdrop.show .cd-preview-modal-dialog {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.cd-preview-modal-header {
  padding: 12px 18px 8px;
  background: #1c1d1f;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-bottom: none;
  flex-shrink: 0;
}

.cd-preview-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
}

.cd-preview-header-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
}

.cd-preview-close-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}

.cd-preview-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.cd-preview-active-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
  margin: 2px 0 2px;
  line-height: 1.35;
  text-align: right;
}

/* Video Player Box */
.cd-preview-player-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cd-preview-video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000000;
  display: block;
}

/* Video Loading Spinner */
.cd-preview-video-loader {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

/* Playlist Section: Takes its comfortable space without inner scroll! */
.cd-preview-playlist-section {
  padding: 12px 0 0;
  background: #1c1d1f;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.cd-preview-playlist-heading {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  padding: 0 18px 8px;
  text-align: right;
}

/* Unconstrained Playlist: All rows render in full height, whole modal scrolls! */
.cd-preview-playlist-list {
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Playlist Row Item: Compact and proportional matching Image 2 */
.cd-preview-playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid #282c37;
  cursor: pointer;
  transition: background-color 0.2s ease;
  user-select: none;
  outline: none;
  min-height: 54px;
  background-color: #1c1d1f;
}

.cd-preview-playlist-item:hover {
  background-color: #23252c;
}

.cd-preview-playlist-item.active {
  background-color: #252a3a;
}

/* Thumbnail Wrap (Right in RTL) */
.cd-playlist-thumb-wrap {
  width: 70px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: #0f172a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.cd-playlist-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Title & Active Icon Wrap (Center in RTL) */
.cd-playlist-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
  min-width: 0;
}

/* Active circular play icon matching Image 2, 4, 5 */
.cd-playlist-playing-icon {
  display: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.cd-preview-playlist-item.active .cd-playlist-playing-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cd-playlist-title {
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: right;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.cd-preview-playlist-item.active .cd-playlist-title {
  font-weight: 700;
  color: #ffffff;
}

/* Duration (Left in RTL) */
.cd-playlist-duration {
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  direction: ltr;
  min-width: 36px;
  text-align: left;
}

.cd-preview-playlist-item.active .cd-playlist-duration {
  color: #ffffff;
  font-weight: 700;
}

/* Responsive on Mobile */
@media (max-width: 767.98px) {
  .cd-preview-modal-backdrop {
    padding: 18px 8px 48px;
  }

  .cd-preview-modal-dialog {
    max-width: 100%;
    height: auto;
    max-height: none;
    border-radius: 10px;
  }

  .cd-preview-modal-header {
    padding: 12px 14px 8px;
  }

  .cd-preview-active-title {
    font-size: 0.95rem;
  }

  .cd-preview-playlist-heading {
    padding: 0 14px 8px;
    font-size: 0.88rem;
  }

  .cd-preview-playlist-item {
    padding: 10px 14px;
    gap: 10px;
    min-height: 50px;
  }

  .cd-playlist-thumb-wrap {
    width: 64px;
    height: 36px;
  }

  .cd-playlist-title {
    font-size: 0.82rem;
  }

  .cd-playlist-duration {
    font-size: 0.78rem;
  }
}



