/* ============================================
   Khóa học của tôi - CSS
   Chỉ style phần card grid bên phải
   ============================================ */

/* --- Main Content (phải) --- */
.main-class {
  flex: 1;
  min-width: 0;
}

/* --- Grid khóa học --- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* --- Card khóa học --- */
.course-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #dbe2ea;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    box-shadow 0.25s,
    transform 0.25s;
  cursor: pointer;
}

.course-card:hover {
  box-shadow: 0 8px 30px rgba(46, 50, 147, 0.12);
  transform: translateY(-3px);
}

/* Thumbnail */
.course-card .course-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
}

.course-card .course-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

.course-card:hover .course-card-thumb img {
  transform: scale(1.04);
}

/* Badge trạng thái trên thumb */
.course-card .course-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.course-badge.course-badge-active {
  background: rgba(13, 188, 123, 0.85);
  color: #fff;
}

.course-badge.course-badge-done {
  background: rgba(255, 255, 255, 0.85);
  color: #2e3293;
}

.course-badge.course-badge-pending {
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}

/* Phần nội dung card */
.course-card .course-card-body {
  padding: 16px 16px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Tag tên lớp trên course card */
.course-class-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #0F67BF;
  background: #EFF6FF;
  padding: 3px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s;
  width: fit-content;
}
.course-class-tag:hover {
  background: #DBEAFE;
  color: #0B5299;
}

/* Footer card: luôn ở dưới nhờ course-card-body flex:1 */
.course-card .course-card-footer {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Row thông tin: số bài + thời lượng */
.course-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.course-info-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #64748b;
}

.course-info-item i {
  font-size: 15px;
  color: #94a3b8;
  flex-shrink: 0;
}

.course-card .course-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* Progress bar */
.course-card .course-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.course-progress .course-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.course-progress .course-progress-label span {
  font-size: 12px;
  color: #64748b;
}

.course-progress .course-progress-label strong {
  font-size: 15px;
  font-weight: 700;
  color: #2e3293;
}

/* Inline: thanh + % nằm ngang */
.course-progress .course-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.course-progress .course-progress-row .course-progress-bg {
  flex: 1;
}

.course-progress .course-progress-pct {
  font-size: 14px;
  font-weight: 700;
  color: #2e3293;
  flex-shrink: 0;
  min-width: 34px;
  text-align: right;
}

.course-progress .course-progress-bg {
  height: 8px;
  background: #e2e8f0;
  border-radius: 100px;
  overflow: hidden;
}

.course-progress .course-progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #0dbc7b, #34d399);
  transition: width 0.6s ease;
}

/* Buổi học tiếp theo */
.course-card .course-next-session {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8faff;
  border: 1px solid #e1e7fd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #475569;
}

.course-next-session i {
  font-size: 15px;
  color: #3271e8;
  flex-shrink: 0;
}

.course-next-session .next-time {
  font-weight: 600;
  color: #2e3293;
}

/* --- Box LIVE đang phát --- */
.course-card .course-live-box {
  background: linear-gradient(135deg, #1a1a72 0%, #2e3293 100%);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.course-live-box .course-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px 3px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Ripple pulse cho dot trong LIVE badge */
.course-live-pulse {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.course-live-dot {
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

.course-live-pulse::before,
.course-live-pulse::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  animation: liveRipple 2s ease-out infinite;
}

.course-live-pulse::after {
  animation-delay: 0.75s;
}

@keyframes liveRipple {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

.course-live-box .course-live-title {
  flex: 1;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-live-box .course-live-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffa515;
  color: #1a1a72;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}

.course-live-box .course-live-btn:hover {
  background: #ffb600;
  color: #1a1a72;
}

/* --- Box chưa có lịch --- */
.no-schedule-box {
  justify-content: flex-start;
}

.no-schedule-box .course-btn-schedule {
  margin-left: auto;
}

/* --- Box phòng chung: Vào lớp sau & Bài tiếp theo --- */
.course-session-box {
  background: #f0f4ff;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  border: solid 1px transparent;
  transition: 0.2s;
}

.course-session-box:hover {
  border-color: #aab3d1;
  background: transparent;
}

/* Layout 2 cột dùng chung */
.course-session-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.course-session-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
  background: #2e3293;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 10px;
}

.course-session-tag i {
  font-size: 12px;
}

.course-session-name {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-session-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

/* Countdown timer */
.course-countdown {
  font-size: 18px;
  font-weight: 800;
  color: #d97707;
  font-family: "Inter", monospace;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

/* Next session time/date */
.course-session-time {


  font-size: 13px;
  color: #64748b;
  line-height: 1.2;
  margin-top: 3px;
}

.course-session-date {
  font-size: 12px;
  font-weight: 700;
  color: #2e3293;
  line-height: 1.2;
}


/* --- Button chọn lịch --- */
.course-btn-schedule {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  background: #ce2368;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.course-btn-schedule:hover {
  background: #e62773;
  color: #fff;
}


/* ============================================
   MODAL: Chọn lịch học
   ============================================ */

/* Modal content wrapper */
.schedule-modal-content {
  padding: 52px;
}

/* --- Tab bar (uses flex-title-tab-assign from AES) --- */
.schedule-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 500;
  transition: all .3s;
  cursor: pointer;
  position: relative;
  top: 1px;
  padding-bottom: 4px;
}

.schedule-tab i {
  font-size: 17px;
}

.schedule-tab:hover {
  color: #4141A8;
}

.schedule-tab.active {
  color: #4141A8;
  font-weight: 600;
}

.schedule-tab.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  right: 0;
  height: 3px;
  background: #4141A8;
  border-radius: 3px;
  width: 50px;
  transform: translateX(-50%);
}

/* --- Tab content --- */
.schedule-tab-content {
  display: none;
}

.schedule-tab-content.active {
  display: block;
}

/* --- Tab 1: Preset schedule options --- */
.schedule-option-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.schedule-option-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid #E0E3E9;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all .3s;
  cursor: pointer;
}

.schedule-option-item:hover {
  border-color: #B8B8E0;
  background: #F8F8FF;
}

.schedule-option-item .ct-check-radio-style {
  flex: 1;
  display: flex;
  align-items: center;
}

.schedule-option-item .ct-check-radio-style label {
  display: flex;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
}

.schedule-option-item .ct-check-radio-style label .name-text {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #1C2B33;
  font-weight: 400;
  top: 1px;
  margin-left: 8px;
}

.schedule-option-item .name-class {
  font-size: 16px;
  font-weight: 600;
  margin-left: 8px;
  flex: 1;
}

.schedule-option-item .date-schedule-learn {
  font-size: 14px;
  margin-left: auto;
  color: #8b8a92;
}


.schedule-option-item .ct-check-radio-style label .checked {
  top: 50%;
  transform: translateY(-50%);
}

.btn-view-book-schedule {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  padding-right: 4px;
  margin-left: 8px;
  border-radius: 8px;
  background: #e0e3fd;
  transition: 0.2s;
}

.btn-view-book-schedule .text {
  font-size: 13px;
  color: #4049b2;
}

.btn-view-book-schedule .icon-chevron {
  display: inline-flex;
  align-items: center;
}

.btn-view-book-schedule .icon-chevron i {
  font-size: 14px;
  color: #4049b2;
  transition: transform 0.25s ease;
}

.btn-view-book-schedule:hover {
  background: #4049b2;
}

.btn-view-book-schedule:hover .text,
.btn-view-book-schedule:hover .icon-chevron i {
  color: #fff;
}

/* Quay mũi tên khi show-table */
.schedule-option-item.show-table .btn-view-book-schedule .icon-chevron i {
  transform: rotate(180deg);
}

/* table-schedule: ẩn mặc định, hiện khi show-table */
.table-schedule {
  display: none;
  width: 100%;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 10px;
}

.schedule-option-item.show-table .table-schedule {
  display: block;

}

.schedule-option-item .tt-cell.header .date {
  font-size: 13px;
}

/* Week navigation */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0;
  background: #ecebf1;
}

.week-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #d0d5dd;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #475569;
}

.week-nav-btn:hover {
  background: #4049b2;
  border-color: #4049b2;
  color: #fff;
}

.week-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.week-nav-btn i {
  font-size: 14px;
}

.week-nav-label {
  font-size: 13px;
  font-weight: 600;
  color: #1c2b33;
  min-width: 170px;
  text-align: center;
}

/* Custom grid 7 ngày cho table trong popup – không scroll ngang */
.schedule-option-item .timetable-grid {
  min-width: 0;
  grid-template-columns: 50px repeat(7, 1fr);
}



/* Time in orange */
.schedule-time {
  color: #4e429f;
  font-weight: 500;
  width: 80px;
}

/* Dot separator */
.schedule-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #acb5c1;
  flex-shrink: 0;
}

/* Active/checked state for option item */
.schedule-option-item.active {
  background: #f7f6fc;
  border-color: #4141A8;
}

/* Slot count */
.schedule-slot-count {
  font-size: 13px;
  color: #858D9A;
  white-space: nowrap;
  margin-left: 8px;
}

.schedule-slot-info {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}

/* "Sắp mở lớp" tag */
.schedule-slot-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #0DBC7B;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}



.schedule-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  height: 44px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
}

/* --- Hint text --- */
.schedule-hint-text {
  text-align: center;
  font-size: 15px;
  color: #858D9A;
  margin-top: 16px;
  line-height: 1.6;
}

.schedule-hint-link {
  color: #dd8027 !important;
  font-weight: 600;
  text-decoration: underline !important;
}

.schedule-hint-link:hover {
  color: #2E2E93 !important;
}

/* --- Tab 2: Custom schedule --- */
.schedule-custom-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #c7701f;
  background: #fff1df;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 20px;
  line-height: 1.4;
}

.schedule-custom-note i {
  font-size: 18px;
  flex-shrink: 0;
}

.schedule-custom-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.schedule-custom-box {
  border: 1px solid #E0E3E9;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .3s;
}

.schedule-custom-box:hover {
  border-color: #B8B8E0;
}

.schedule-custom-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  background: #F5F6FA;
  border-bottom: 1px solid #E0E3E9;
}

.schedule-custom-box-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #1C2B33;
}

.schedule-custom-box-title i {
  font-size: 16px;
  color: #fff;
  background: #2e3293;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}

.schedule-custom-box-delete {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #E14547 !important;
  transition: all .3s;
}

.schedule-custom-box-delete:hover {
  background: #FFE0E0;
  color: #C62828 !important;
}

.schedule-custom-box-delete i {
  font-size: 20px;
}

.schedule-custom-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
}

.schedule-custom-selects .form-select-aes {
  min-width: 160px;
  flex: 1;
}

.btn-add-lc .layout-btn .icon i {
  color: #c47901;
  font-size: 20px;
}