/* ==========================================================
   courses_detail.css — BEELESSON 강의 목록 상세 페이지
   ========================================================== */

.courses-page {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* 히어로 */

.courses-hero {
  padding-top: 1.5rem;
  padding-bottom: 0.5rem;
}

.courses-hero-text {
  max-width: 40rem;
}

.courses-hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.25rem;
}

.courses-hero-title {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
}

.courses-hero-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* 상단 코스 스트립 – 더 얇고 심플하게 */

.courses-strip {
  padding: 0.4rem 0.25rem;   /* 전체적으로 더 얇게 */
  border-radius: 0;          /* 프레임 느낌 제거 */
  background-color: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.courses-strip-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-align: center;
}

.courses-strip-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}

.courses-strip-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: none
}

.courses-strip-scroll {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
  justify-content: center; /* pill 버튼 중앙 정렬 */
  flex-wrap: wrap;         /* 여러 줄로도 자연스럽게 */
}


/* 스크롤바 약하게 (그대로 두되 조금 더 얇게) */
.courses-strip-scroll::-webkit-scrollbar {
  height: 4px;
}
.courses-strip-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.courses-strip-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.courses-strip-empty {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* 코스 선택 pill 버튼 */

.courses-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background-color: var(--bg-alt);
  padding: 0.22rem 0.8rem;
  font-size: 0.78rem;
  line-height: 2;
  white-space: nowrap;
  cursor: pointer;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.12s ease-out,
    border-color 0.12s ease-out,
    color 0.12s ease-out,
    transform 0.08s ease-out;
}

.courses-pill:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
}

.courses-pill.active {
  /* background: radial-gradient(circle at top left, var(--accent-soft), var(--bg-alt)); */
  border-color: var(--accent);
  /* color: var(--accent-strong, #2563eb); */
  background-color: black;
  color:white;
}


/* 메인 레이아웃 */

.courses-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: flex-start;
}

/* 미디어쿼리는 이제 필요 없지만, 두어도 문제는 없음 */
@media (max-width: 1024px) {
  .courses-main {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* 좌측: 메인 정보 – UI에서는 헤더를 숨김 */

.course-main-header {
  display: none;
}

/* 나머지 클래스 정의는 남겨두어도 괜찮음 */
.course-main-eyebrow {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0 0 0.15rem;
}

.course-main-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
}

.course-main-subtitle {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}

.course-main-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}


.course-main-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* 섹션 공통 */

.course-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
}

.course-section-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* 코스 소개 섹션은 UI에서 숨김 */
.course-main-description {
  display: none;
}

/* 커리큘럼 섹션 헤더(제목 + 요약)도 숨김 */
.course-section-header {
  display: none;
}

/* 커리큘럼 컨테이너는 그대로 유지 (레슨 카드만 보여줌) */
.course-main-curriculum {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.course-description-body {
  font-size: 0.9rem;
  color: var(--ink-soft);
  white-space: pre-line;
}

.curriculum-chapter-block {
  padding: 0.35rem 0 0.45rem;  /* 카드 느낌 없이 상하 여백만 */
  margin-bottom: 80px;
  border-radius: 0;             /* 카드 테두리/배경 제거 */
  border: none;
  background: transparent;
  box-shadow: none;
}

.curriculum-chapter-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  padding-bottom: 0.3rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35); /* 가는 구분선만 */
}

.curriculum-chapter-title {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-strong);
  border-left: 10px solid #ffa900;
}


.curriculum-chapter-title span.chapter-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  background: rgba(15, 23, 42, 0.05);
  font-size: 1.5rem;
  font-weight: 700;
}

.curriculum-chapter-title span.chapter-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-strong);
}

.curriculum-chapter-meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.curriculum-chapter-summary {
  margin: 0.25rem 0 0.6rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.5;
  white-space: pre-line; /* keep manual line breaks in summary */
}


/* Lesson cards grid */

.curriculum-lessons-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4rem; /* 카드 사이 간격 더 줄이기 */
}

@media (max-width: 900px) {
  .curriculum-lessons-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.courses-lesson-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;                   /* 내부 간격 축소 */
  align-items: stretch;
  padding: 1rem 1rem 1rem;/* 패딩 더 축소 */
  border-radius: 0.6rem;          /* 모서리 더 살짝 줄이기 */
  border: 1px solid rgba(148, 163, 184, 0.25);
  background-color: var(--bg-alt);
  cursor: pointer;
  transition:
    transform 0.1s ease-out,
    box-shadow 0.1s ease-out,
    border-color 0.1s ease-out,
    background-color 0.1s ease-out;
}

.courses-lesson-thumb {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 11;          /* 더 납작하게 → 전체 높이 감소 */
  border-radius: 0.55rem;
  background: radial-gradient(circle at top left, #f97316, #1f2937 55%, #020617 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.courses-lesson-title {
  font-size: 0.86rem;   /* 한 단계 더 줄이기 */
  font-weight: 700;
  color: var(--ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.courses-lesson-desc {
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.courses-lesson-meta {
  display: flex;
  justify-content: flex-start;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.72rem;
  color: var(--ink-soft);
}


.curriculum-lessons-grid-empty {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* hover/active는 그대로 두거나 살짝 조정 가능 */
.courses-lesson-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  border-color: var(--accent);
  background: radial-gradient(circle at top left, var(--accent-soft), var(--bg-alt));
}

.courses-lesson-card.active {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  background: radial-gradient(circle at top left, var(--accent-soft), var(--bg-alt));
}



.courses-lesson-thumb-inner {
  text-align: center;
  color: #f9fafb;
  padding: 0.35rem 0.5rem;
}

/* Right content side → 이제는 아래쪽 content 블록 */

.courses-lesson-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* 타이틀/뱃지 행: 좌측 정렬 */

.courses-lesson-title-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.35rem;
  align-items: center;
}

/* 설명/메타는 그대로 사용 (원본 정의 유지) */

.courses-lesson-badges {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  flex-shrink: 0;
}

.courses-lesson-badge {
  font-size: 0.7rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink-soft);
  background-color: rgba(15, 23, 42, 0.02);
  white-space: nowrap;
}

.courses-lesson-badge.free {
  border-color: var(--accent);
  color: var(--accent);
  background-color: rgba(59, 130, 246, 0.05);
}

.courses-lesson-meta-duration::before {
  content: '⏱';
  font-size: 0.8rem;
  margin-right: 0.2rem;
}


/* 우측: 사이드 카드 */
.courses-main-right {
  display: none !important;
}

.course-side-card {
  border-radius: 1rem;
  overflow: hidden;
  background-color: var(--card-bg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.course-side-cover {
  position: relative;
  height: 160px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.course-side-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.75),
    rgba(15, 23, 42, 0.2)
  );
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  padding: 0.75rem;
}

.course-side-cover-label {
  font-size: 0.78rem;
  color: #f9fafb;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.7);
}

.course-side-body {
  padding: 0.9rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.course-side-price {
  font-size: 1.1rem;
  font-weight: 700;
}

.course-side-buy-btn {
  width: 100%;
}

.course-side-help {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.course-side-stats {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* 플레이어 placeholder */

.course-player-placeholder {
  margin-top: 1rem;
  border-radius: 1rem;
  border: 1px dashed var(--border);
  background-color: var(--bg-soft);
  padding: 0.9rem 0.9rem;
}

.course-player-label {
  margin: 0 0 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.course-player-text {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* 접근 권한 모달 */

.course-access-modal {
  max-width: 420px;
}

.course-access-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

/* ------------------ Lesson player modal ------------------ */

.lesson-player-modal {
  max-width: 960px;
}

.lesson-player-header {
  margin-bottom: 0.75rem;
}

.lesson-player-course-title {
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.lesson-player-lesson-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.lesson-player-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lesson-player-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.9rem;
  overflow: hidden;
  background-color: #000;
}

.lesson-player-video {
  width: 100%;
  height: 100%;
  display: block;
  background-color: #000;
}

.lesson-player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #e5e7eb;
  background: radial-gradient(circle at center,
    rgba(15, 23, 42, 0.7),
    rgba(15, 23, 42, 0.9));
}

.lesson-player-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}


/* =========================
   수강평 사이드 영역
   ========================= */

.course-review-side {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: #0f172a;
  color: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.course-review-side-empty {
  opacity: 0.85;
}

.course-review-side-summary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.course-review-side-score {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.course-review-side-score #courseReviewAvg {
  font-size: 1.3rem;
}

.course-review-stars {
  display: inline-flex;
  gap: 0.1rem;
  font-size: 0.95rem;
}

.course-review-star-icon {
  opacity: 0.3;
}

.course-review-star-icon.filled {
  opacity: 1;
}

.course-review-side-count {
  margin: 0;
  font-size: 0.85rem;
  color: #e5e7eb;
}

.course-review-side-btn {
  width: 100%;
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
}

/* =========================
   수강평 모달
   ========================= */

.course-review-modal {
  max-width: 640px;
}

.course-review-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.course-review-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.course-review-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.course-review-stars-select {
  display: inline-flex;
  gap: 0.3rem;
}

.course-review-star-input {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
  opacity: 0.35;
}

.course-review-star-input.selected {
  opacity: 1;
  transform: scale(1.1);
}

.course-review-input,
.course-review-textarea {
  border-radius: 0.5rem;
  border: 1px solid #1f2937;
  background: #020617;
  color: var(--ink-normal);
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  color:white;
}

.course-review-input:focus,
.course-review-textarea:focus {
  outline: 2px solid #f97316;
  outline-offset: 1px;
}

.course-review-error {
  margin: 0;
  font-size: 0.8rem;
  color: #f97373;
  min-height: 1.1em;
}

.course-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.course-review-delete-btn {
  color: #ef4444;
  border-color: #ef4444;
}

/* =========================
   수강평 개수 텍스트 (링크 느낌)
   ========================= */

.course-review-count-link {
  text-decoration: underline;
  cursor: pointer;
}

/* =========================
   전체 수강평 리스트 모달
   ========================= */

.course-review-list-modal {
  max-width: 720px;
}

.course-review-list-body {
  margin-top: 1rem;
  max-height: 480px;
  overflow-y: auto;
}

.course-review-list-loading {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.course-review-list-empty {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.course-review-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.course-review-item {
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  background: #020617;
  border: 1px solid #1f2937;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.course-review-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.course-review-item-user {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.course-review-item-meta {
  display: flex;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.course-review-item-rating {
  font-weight: 600;
}

.course-review-item-date {
  opacity: 0.8;
}

.course-review-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-normal);
}

.course-review-item-body {
  font-size: 0.9rem;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

/* =======================
   Mobile: YouTube-style lesson list
   ======================= */
@media (max-width: 768px) {
  /* 하나의 카드가 한 줄 전체를 쓰도록 */
  .curriculum-lessons-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
  }

  .courses-lesson-card {
    flex-direction: row;              /* 썸네일 왼쪽, 내용 오른쪽 */
    align-items: flex-start;
    padding: 0.55rem 0.6rem;          /* 모바일용 더 타이트한 패딩 */
    gap: 0.5rem;                      /* thumb와 content 사이 간격 */
  }

  .courses-lesson-thumb {
    flex: 0 0 38%;                    /* 전체 폭의 ~1/3~2/5 정도 차지 */
    max-width: 150px;
    aspect-ratio: 16 / 9;             /* 가로형 비디오 썸네일 느낌 */
    border-radius: 0.45rem;
  }

  .courses-lesson-content {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.25rem;
  }

  .courses-lesson-title {
    font-size: 0.84rem;
    white-space: normal;              /* 모바일에서는 두 줄까지 허용 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .courses-lesson-desc {
    font-size: 0.72rem;
    max-height: 2.4em;
  }

  .courses-lesson-meta {
    font-size: 0.7rem;
    flex-wrap: wrap;
  }
}




