/**
 * MyClass Card Layout Styles
 * 수강중인 과정 / 수강완료과정 카드형식 레이아웃
 * Created: 2025-12-03
 */

/* ============================================
   검색 필터 영역
   ============================================ */
.myclass-search-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.myclass-search-container .filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.myclass-search-container .filter-btn {
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.myclass-search-container .filter-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.myclass-search-container .filter-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.myclass-search-container .date-input {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  width: 140px;
}

.myclass-search-container .date-separator {
  color: #9ca3af;
  font-size: 14px;
}

.myclass-search-container .search-btn {
  padding: 8px 20px;
  background: linear-gradient(135deg, #667eea 0%, #3182ce 100%);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.myclass-search-container .search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ============================================
   안내 메시지
   ============================================ */
.myclass-info-alert {
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
  border-left: 4px solid #3b82f6;
  padding: 16px 20px;
  margin-bottom: 24px;
  border-radius: 0 8px 8px 0;
}

.myclass-info-alert p {
  color: #1e40af;
  font-weight: 500;
  font-size: 14px;
  margin: 6px 0;
  line-height: 1.6;
}

.myclass-info-alert p:first-child {
  margin-top: 0;
}

.myclass-info-alert p:last-child {
  margin-bottom: 0;
}

/* ============================================
   카드 그리드 레이아웃
   ============================================ */
.myclass-card-grid {
  display: grid;
  /* ✅ 수정 (2026-05-14 v2): 4개 한 줄 가능하도록 기존 360px 복원, 사업주 카드 글씨 잘림은 폰트/gap 축소로 해결 */
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 480px) {
  .myclass-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   개별 과정 카드 - 새로운 디자인
   ============================================ */
.myclass-course-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  background-image: linear-gradient(#fff, #fff), linear-gradient(#a6b7ef, #a6e2d2);
  background-origin: border-box;
  background-clip: content-box, border-box;
}

.myclass-course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 카드 상단 이미지 영역 */
.card-thumbnail {
  position: relative;
  height: 140px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.card-thumbnail-placeholder .placeholder-icon {
  font-size: 48px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.card-thumbnail-placeholder .placeholder-text {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 500;
}

/* 과정 유형 배지 - 이미지 위 */
.course-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

/* 사업주훈련 배지 */
.course-type-badge.business {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
}

/* ✅ 추가 (2026-05-14): 법정과정 배지 (녹색) */
.course-type-badge.legal {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

/* ✅ 추가 (2026-05-14): 산업안전과정 배지 (오렌지, 기본 유지) */
.course-type-badge.safety {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

/* 수료/미수료 상태 배지 */
.course-type-badge.pass-complete {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.course-type-badge.pass-incomplete {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.course-type-badge.pass-progress {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

/* ============================================
   카드 하단 정보 영역 - 새로운 디자인
   ============================================ */
.card-content-section {
  padding: 16px;
  display: flex;
  gap: 16px;
}

.card-info-left {
  flex: 1;
  min-width: 0;
}

.card-info-right {
  flex-shrink: 0;
  width: 80px;
}

/* 과정명 */
.card-course-title {
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 학습 기간 */
.card-course-period {
  color: #6b7280;
  font-size: 12px;
  margin-bottom: 6px;
}

.card-course-period .days-left {
  display: inline-block;
  padding: 2px 6px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 500;
  font-size: 11px;
}

/* 총점 */
.card-total-score {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
}

.card-total-score span {
  font-weight: 600;
  color: #1f2937;
}

/* 평가 상태 영역 - 한 줄 표시 */
/* ✅ 수정 (2026-04-23): 폰트 크기 상향 + 2줄 방지 */
/* ✅ 수정 (2026-05-14 v2): 4개 한 줄(360px) 환경에서 사업주 카드 글씨 잘림 방지 — 폰트/gap/padding 미세 축소 */
.card-eval-line {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.4;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  position: relative;
  width: calc(100% + 96px);
}

.card-eval-line .eval-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-eval-line .eval-label {
  color: #6b7280;
  font-weight: 500;
  font-size: 12px;
}

.card-eval-line .eval-status {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

/* 미응시/미제출 상태 */
.card-eval-line .eval-status.not-done {
  background: #fee2e2;
  color: #dc2626;
}

/* 응시완료/제출완료 상태 */
.card-eval-line .eval-status.done {
  background: #d1fae5;
  color: #059669;
}

/* 없음 상태 */
.card-eval-line .eval-status.none {
  background: #f3f4f6;
  color: #9ca3af;
}

/* 점수 표시 */
.card-eval-line .eval-status.score {
  background: #dbeafe;
  color: #2563eb;
}

.card-eval-line .eval-separator {
  color: #d1d5db;
  margin: 0 2px;
  font-size: 13px;
}

/* ✅ 추가 (2026-05-14): 법정과정 이수/학습중 배지 */
.card-eval-line.legal-status {
  justify-content: center;
  white-space: normal;
  width: 100%;
}

.legal-badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.legal-badge.done {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 1px solid #10b981;
}

.legal-badge.in-progress {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #f59e0b;
}

/* ✅ 추가 (2026-05-14): 산업안전과정 퀴즈 한 줄 표시 (기존 eval-line 활용) */
.card-eval-line.safety-quiz {
  width: 100%;
}

/* ✅ 추가 (2026-05-14 v6): 수료 상태 파란 배지 (완료/학습완료/수료) — 흰 글씨 */
.card-eval-line .eval-status.pass {
  background: #3b82f6;
  color: #ffffff;
}

/* ✅ 추가 (2026-05-14 v6): 미수료 옆 인라인 안내문 (작은 회색 글씨) */
/* ✅ 수정 (2026-05-14 v7): 미수료 배지와 시각적 정렬 맞춤 (살짝 위로 이동) */
/* ✅ 수정 (2026-05-14 v8): 폰트 10px → 11px 상향 */
.pass-condition-hint-inline {
  margin-left: 6px;
  font-size: 11px;
  color: #6b7280;
  font-weight: 400;
  white-space: nowrap;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* 평가 상태 영역 - 기존 (하위 호환) */
.card-eval-section {
  margin-top: 10px;
  border-top: 1px solid #f3f4f6;
  padding-top: 10px;
}

.card-eval-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}

.card-eval-row .eval-label {
  color: #6b7280;
  font-weight: 500;
}

.card-eval-row .eval-value {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.card-eval-row .eval-value.none {
  background: #f3f4f6;
  color: #9ca3af;
}

.card-eval-row .eval-value.complete {
  background: #d1fae5;
  color: #059669;
}

.card-eval-row .eval-value.incomplete {
  background: #fee2e2;
  color: #dc2626;
}

/* 기존 평가 상태 라인 (하위 호환) */
.card-status-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  margin-bottom: 4px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #6b7280;
}

.status-tag.complete {
  color: #059669;
}

.status-tag.incomplete {
  color: #dc2626;
}

/* 진도율 원형 차트 - CSS 방식 */
.progress-circle-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
}

.progress-circle-css {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.progress-circle-css .circle-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    #fe9e09 var(--progress, 0%),
    #e5e7eb var(--progress, 0%)
  );
}

.progress-circle-css .circle-inner {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.progress-circle-css .progress-value {
  font-size: 16px;
  font-weight: 700;
  color: #fe9e09;
  line-height: 1;
}

/* ✅ 추가 (2026-04-22): 모든차시 수강완료 시 녹색 원 스타일 */
.progress-circle-css.all-completed .circle-bg {
  background: conic-gradient(
    #10b981 var(--progress, 100%),
    #d1fae5 var(--progress, 100%)
  );
}

.progress-circle-css.all-completed .progress-complete-text {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  line-height: 1.2;
  text-align: center;
}

/* 기존 SVG 방식 (하위 호환) */
.progress-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 3px solid #e5e7eb;
}

.progress-circle-inner {
  text-align: center;
  z-index: 2;
}

.progress-circle-value {
  font-size: 18px;
  font-weight: 700;
  color: #3b82f6;
  line-height: 1;
}

/* SVG 진도 원형 */
.progress-ring {
  position: absolute;
  top: -3px;
  left: -3px;
  transform: rotate(-90deg);
}

.progress-ring-circle-bg {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 6;
}

.progress-ring-circle {
  fill: none;
  stroke: #3b82f6;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

/* ============================================
   카드 버튼 영역
   ============================================ */
.card-buttons-section {
  padding: 0 16px 16px 16px;
  display: flex;
  gap: 8px;
}

/* 카드 하단 버튼 영역 */
.card-action-buttons {
  display: flex;
  gap: 10px;
}

.card-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
}

.card-btn-primary {
  background: linear-gradient(296deg, #43659e 0%, #476aa7 100%);
  color: #fff;
}

.card-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  color: #fff;
}

.card-btn-secondary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
}

.card-btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  color: #fff;
}

.card-btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
}

.card-btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  color: #fff;
}

.card-btn-disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}

.card-btn-disabled:hover {
  transform: none;
  box-shadow: none;
}

/* 3개 버튼 레이아웃 - 한 줄 */
.card-buttons-section.card-buttons-three {
  flex-wrap: nowrap;
}

.card-buttons-section.card-buttons-three .card-btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 12px;
  min-width: 0;
}

/* ============================================
   수료 상태 배지
   ============================================ */
.pass-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.pass-status-badge.complete {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.pass-status-badge.incomplete {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.pass-status-badge.progress {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

/* ============================================
   빈 상태
   ============================================ */
.myclass-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #f8fafc;
  border-radius: 16px;
  margin-top: 20px;
}

.myclass-empty-state .empty-icon {
  font-size: 48px;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.myclass-empty-state .empty-title {
  font-size: 18px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
}

.myclass-empty-state .empty-description {
  font-size: 14px;
  color: #94a3b8;
}

/* ============================================
   반응형 디자인
   ============================================ */
@media (max-width: 768px) {
  .myclass-search-container {
    justify-content: center;
  }

  .myclass-card-grid {
    grid-template-columns: 1fr;
  }

  .card-score-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-action-buttons {
    flex-direction: column;
  }
}

/* ============================================
   애니메이션
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.myclass-course-card {
  animation: fadeInUp 0.4s ease forwards;
}

.myclass-course-card:nth-child(1) {
  animation-delay: 0.1s;
}
.myclass-course-card:nth-child(2) {
  animation-delay: 0.15s;
}
.myclass-course-card:nth-child(3) {
  animation-delay: 0.2s;
}
.myclass-course-card:nth-child(4) {
  animation-delay: 0.25s;
}
.myclass-course-card:nth-child(5) {
  animation-delay: 0.3s;
}
.myclass-course-card:nth-child(6) {
  animation-delay: 0.35s;
}
