/* ============================================
   Dashboard Học Sinh CSS
   ============================================ */

/* --- 1. Box bài học (Đang diễn ra & Sắp tới) --- */
.box-current-lesson {
    background: #eef6ff;
    border: solid 1px #62a5f6;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
}


.box-current-lesson .icon-cam {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.box-current-lesson .icon-cam img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.box-current-lesson .course-name i {
    font-size: 16px;
    flex-shrink: 0;
}

.box-current-lesson .info {
    flex: 1;
}

/* Live badge (red) — reuse style from course-live-badge */
.box-current-lesson .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 3px 8px 3px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.box-current-lesson .status-badge.upcoming {
    background: #3b82f6;
}

/* Ripple pulse dot */
.box-current-lesson .status-badge .dot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.box-current-lesson .status-badge .dot .pulse-inner {
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    position: relative;
    z-index: 1;
}

.box-current-lesson .status-badge .dot::before,
.box-current-lesson .status-badge .dot::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: liveRipple 2s ease-out infinite;
}

.box-current-lesson .status-badge .dot::after {
    animation-delay: 0.75s;
}

@keyframes liveRipple {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(3.2);
        opacity: 0;
    }
}

.box-current-lesson .lesson-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
    color: #2e3293;
}

.box-current-lesson .course-name {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.box-current-lesson .action {
    display: flex;
    align-items: center;
    gap: 15px;
}

.box-current-lesson .button-bg {
    background: #0F67BF;
    height: 40px;
    width: auto;
    padding: 0 20px;
    border-radius: 8px;
    white-space: nowrap;
}

.box-current-lesson .button-bg:hover {
    background: #0B5299;
    transform: translateY(-1px);
}

.box-current-lesson .button-bg .txt {
    font-size: 14px;
    font-weight: 600;
}


.box-current-lesson .time-info {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
}

.box-current-lesson .countdown {
    color: #3271e8;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    line-height: 1;
    width: 112px;
    text-align: right;
}


@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

/* --- 2. Thống kê (Quick Stats) --- */
.item-statistical .icon i {
    font-size: 32px;
    position: relative;
}

/* Màu icon đậm theo tone nền card */
.item-statistical-yellow .icon i {
    color: #e58f09;
    /* Dark Amber */
}

.item-statistical-gray .icon i {
    color: #325d6c;
    /* Dark Slate */
}

.item-statistical-purple .icon i {
    color: #2459bb;
    /* Dark Blue */
}

.item-statistical-green .icon i {
    color: #229674;
    /* Dark Green */
}

.item-statistical .icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 2. Thời khóa biểu (Timetable) --- */
/* Áp dụng style title-item từ AES */
.card-dashboard {
    background: #fff;
    border: 1px solid rgba(224, 227, 233, 1);
    border-radius: 8px;
}

.card-dashboard-header {
    padding: 11px 16px;
    background: rgba(235, 239, 243, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-dashboard-header .name {
    font-size: 18px;
    font-weight: 700;
    color: rgba(28, 43, 51, 1);
    margin: 0;
}

.card-dashboard-header .actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-picker-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--dark-color-text);
    cursor: pointer;
}

.date-picker-custom input {
    border: none;
    background: transparent;
    outline: none;
    width: 190px;
    font-family: inherit;
    color: inherit;
}

/* Timetable Grid */
.timetable-wrapper {
    overflow: visible;
    /* Cho popup không bị cắt */
    position: relative;
    background: #fff;
}

.timetable-grid {
    min-width: 800px;
    /* Force scroll on mobile */
    display: grid;
    /* 1 col cho Time lable (80px), 10 col cho 10 ngày (1fr) */
    grid-template-columns: 70px repeat(10, minmax(100px, 1fr));
}

.tt-cell {
    border-right: 1px solid #e1e6eb;
    border-bottom: 1px solid #e1e6eb;
    padding: 6px 6px;
    min-height: 32px;
    position: relative;
    transition: 0.3s;
}



.tt-cell.header:nth-child(11n) {
    border-right: none;
}

.tt-cell.header {
    text-align: center;
    padding: 6px 6px;
    border-bottom: 1px dashed #8794a5;
}

.tt-cell.header .day {
    font-size: 13px;
    color: #64748B;
}

.tt-cell.header .date {
    font-size: 15px;
    font-weight: 700;
    margin-top: -2px;
}

.tt-cell.header.today .day,
.tt-cell.header.today .date {
    color: #0F67BF;
}

.tt-cell.time-label {
    font-size: 13px;
    color: #64748B;
    text-align: center;

    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 1px dashed #8794a5;
}

.tt-cell.time-label-header {
    position: sticky;
    left: 0;
    z-index: 3;
    border-right: 1px dashed #8794a5;
    border-bottom: 1px dashed #8794a5;
}


/* Lesson box in timetable */
.tt-lesson {
    background: rgba(15, 103, 191, 0.1);
    border-left: 3px solid #0F67BF;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    margin-bottom: 4px;
}

.tt-lesson:last-child {
    margin-bottom: 0;
}

.tt-lesson .time {
    color: #0F67BF;
    font-weight: 600;
}

.tt-lesson .title {
    color: #1E293B;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Past sessions */
.tt-lesson.past {
    background: rgba(148, 163, 184, 0.12);
    border-left-color: #94A3B8;
    opacity: 0.65;
}

.tt-lesson.past .time {
    color: #94A3B8;
}

.tt-lesson.past .title {
    color: #94A3B8;
}

.tt-past-label {
    display: inline-block;
    font-size: 10px;
    color: #64748B;
    background: rgba(148, 163, 184, 0.18);
    border-radius: 3px;
    padding: 1px 5px;
    margin-top: 2px;
    line-height: 1.4;
}

/* Tooltip/Mini Popup TKB */
.tt-popup {
    position: absolute;
    top: 0;
    left: calc(100% + 10px);
    width: 260px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all .2s;
    border: 1px solid #E2E8F0;
}

/* Mũi tên tooltip */
.tt-popup::after {
    content: '';
    position: absolute;
    top: 16px;
    left: -5px;
    transform: rotate(45deg);
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
}

.tt-cell:hover .tt-popup {
    opacity: 1;
    visibility: visible;
}

/* Fix z-index grid lines */
.tt-cell {
    z-index: 1;
}

.tt-cell:hover {
    z-index: 100;
}

/* Chỉ highlight ô có bài học khi hover */
.tt-cell:has(.tt-lesson)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: solid 1px #f5ac2b;
    z-index: 1;
    transition: 0.2s;
    opacity: 0;
}

.tt-cell:has(.tt-lesson):hover {
    cursor: pointer;
}

.tt-cell:has(.tt-lesson):hover::before {
    opacity: 1;
}

/* Nếu box nằm sát mép phải màn hình hoặc gần cuối */
.tt-cell:nth-child(11n),
.tt-cell:nth-child(11n - 1),
.tt-cell:nth-child(11n - 2) {
    /* Các cột cuối */
}

.timetable-grid .tt-cell:nth-child(11n) .tt-popup,
.timetable-grid .tt-cell:nth-child(11n - 1) .tt-popup,
.timetable-grid .tt-cell:nth-child(11n - 2) .tt-popup {
    left: auto;
    right: calc(100% + 10px);
}

.timetable-grid .tt-cell:nth-child(11n) .tt-popup::after,
.timetable-grid .tt-cell:nth-child(11n - 1) .tt-popup::after,
.timetable-grid .tt-cell:nth-child(11n - 2) .tt-popup::after {
    left: auto;
    right: -5px;
    transform: rotate(225deg);
}

.tt-popup .p-time {
    color: #7f92a4;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #E2E8F0;
}

.tt-popup .p-title {
    font-size: 14px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 4px;
    line-height: 1.4;
}

/* Lesson item inside popup */
.tt-popup .p-lesson-item {
    padding: 8px 0;
    border-bottom: 1px solid #F1F5F9;
}

.tt-popup .p-lesson-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tt-popup .p-lesson-item:first-of-type {
    padding-top: 0;
}

.tt-popup .p-lesson-time {
    font-size: 13px;
    font-weight: 600;
    color: #0F67BF;
    margin-bottom: 2px;
}

.tt-popup .p-course {
    font-size: 13px;
    color: #64748B;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.tt-popup .p-time i,
.tt-popup .p-course i {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.date-picker-custom i {
    font-size: 16px;
    color: #64748B;
}

/* Nút Bắt đầu dạy / Vào lớp trong popup */
.tt-popup .p-btn-join {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 6px 14px;
    background: #0F67BF;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.tt-popup .p-btn-join:hover {
    background: #0B5299;
    transform: translateY(-1px);
}

.tt-popup .p-btn-join i {
    font-size: 15px;
    color: #fff;
    margin-top: 0;
}

/* --- 3. Biểu đồ Chart --- */
.chart-container {
    height: 400px;
    width: 100%;
    padding: 20px;
}

/* --- 4. Table Khóa học --- */
.table-courses {
    width: 100%;
    border-collapse: collapse;
}

.table-courses th {
    background: transparent;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #64748B;
    text-align: left;
    border-bottom: 1px dashed #8794a5;
}

.table-courses td {
    padding: 16px;
    border-bottom: 1px solid #e1e6eb;
    vertical-align: middle;
}

.table-courses tr:last-child td {
    border-bottom: none;
}

.table-courses tr {
    transition: all .2s;
    cursor: pointer;
}

.table-courses tr:hover {
    background: #F8FAFC;
}

.course-info-td {
    display: flex;
    align-items: center;
    gap: 16px;
}

.course-info-td .thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.course-info-td .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-info-td .name {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-date-td {
    font-size: 14px;
    color: #475569;
}

.text-date-td .label-inactive {
    display: inline-block;
    background: #F1F5F9;
    color: #64748B;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

/* Progress bar cho list khóa học */
.course-progress-td {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 150px;
}

.course-progress-td .bar-bg {
    flex: 1;
    height: 8px;
    background: #E2E8F0;
    border-radius: 100px;
    overflow: hidden;
}

.course-progress-td .bar-fill {
    height: 100%;
    background: #08BF72;
    border-radius: 100px;
}

.course-progress-td .pct {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    width: 40px;
}

.btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    height: 32px;
    padding: 0 12px;
    gap: 0 8px;
    border: 1px solid transparent;
    transition: all .3s;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.btn-table-action.primary {
    background: #E1E7FD;
    color: #4A4AB0;
    border: solid 1px transparent;
}

.btn-table-action.primary:hover {
    background: transparent;
    border-color: #4A4AB0;
}

.btn-table-action.secondary {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
}

.btn-table-action.secondary:hover {
    background: #E2E8F0;
}

/* --- Course summary on class overview --- */
.link-view-all {
    font-size: 13px;
    color: #0F67BF;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}
.link-view-all:hover {
    text-decoration: underline;
}

.course-summary-list {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.course-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.course-summary-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
}
.course-summary-name {
    font-size: 14px;
    font-weight: 600;
    color: #1C2B33;
    margin: 0;
    line-height: 1.3;
}
.course-summary-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #64748B;
    margin-top: 2px;
}
.course-summary-meta i {
    margin-right: 2px;
}