/* timetable.css - CSS ພື້ນຖານສຳລັບຕາຕະລາງຮຽນ */

/* === ໂຄງສ້າງຫຼັກ === */
.timetable-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.timetable-header {
    background: #f8f9fa;
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
}

.timetable-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.timetable-meta {
    color: #6c757d;
    font-size: 14px;
    margin-top: 4px;
}

/* === ຂໍ້ມູນຫ້ອງຮຽນ === */
.class-info-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.class-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.class-info-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.conflict-badge {
    display: inline-flex;
    align-items: center;
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #ffeaa7;
}

.class-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    color: #6c757d;
    font-size: 14px;
}

.info-value {
    font-weight: 500;
    color: #212529;
    font-size: 14px;
}

.info-value.empty {
    color: #adb5bd;
}

/* === ສະຖິຕິການໃຊ້ງານ === */
.usage-stats {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    text-align: center;
}

.stat-card {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stat-card.blue {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.stat-card.gray {
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.stat-card.green {
    background: #e8f5e8;
    border-color: #c8e6c9;
}

.stat-card.purple {
    background: #f3e5f5;
    border-color: #e1bee7;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-number.blue { color: #1976d2; }
.stat-number.gray { color: #757575; }
.stat-number.green { color: #388e3c; }
.stat-number.purple { color: #7b1fa2; }

.stat-label {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.8;
}

/* === Grid ຫຼັກ === */
.timetable-grid {
    display: grid;
    grid-template-columns: 120px repeat(5, 1fr); /* ປ່ຽນເປັນ 5 ວັນ (ຈັນ-ສຸກ) */
    gap: 1px;
    background: #e9ecef;
    width: 100%;
    border: 1px solid #dee2e6;
}

/* === Container === */
.timetable-container {
    overflow-x: auto; /* ເພີ່ມ scroll ແນວນອນຖ້າຈຳເປັນ */
}

/* === Header Cells === */
.time-header,
.day-header {
    background: #495057;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.time-header {
    background: #343a40;
}

/* === Time Column === */
.time-cell {
    background: #f8f9fa;
    padding: 8px;
    border-right: 2px solid #dee2e6;
    text-align: center;
    font-size: 12px;
    color: #495057;
}

.time-text {
    font-weight: 600;
    margin-bottom: 2px;
}

.period-text {
    color: #6c757d;
}

/* === Schedule Cells === */
.schedule-cell {
    background: white;
    padding: 8px;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 12px;
    line-height: 1.3;
}

.schedule-cell.empty {
    background: #f8f9fa;
    color: #adb5bd;
    align-items: center;
    font-size: 16px;
}

.schedule-cell.has-content {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
}

/* === Cell Content === */
.subject-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 2px;
}

.teacher-name {
    color: #495057;
    margin-bottom: 2px;
}

.room-name {
    color: #6c757d;
    font-size: 11px;
}

/* === Break Periods === */
.schedule-cell.break {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    text-align: center;
    font-weight: 600;
    color: #856404;
}

/* === Conflict Indicator === */
.schedule-cell.conflict {
    background: #f8d7da;
    border-left: 3px solid #dc3545;
}

.conflict-icon {
    color: #dc3545;
    font-size: 10px;
    margin-left: 4px;
}

/* === Dark Mode === */
.dark .timetable-wrapper {
    background: #374151;
}

.dark .timetable-header {
    background: #4b5563;
    border-color: #6b7280;
}

.dark .timetable-title {
    color: #f9fafb;
}

.dark .timetable-meta {
    color: #d1d5db;
}

.dark .class-info-card {
    background: #374151;
}

.dark .class-info-title {
    color: #f9fafb;
}

.dark .info-label {
    color: #d1d5db;
}

.dark .info-value {
    color: #f9fafb;
}

.dark .usage-stats {
    border-color: #6b7280;
}

.dark .stat-card {
    background: #4b5563;
    border-color: #6b7280;
    color: #f9fafb;
}

.dark .schedule-cell {
    background: #4b5563;
    color: #f9fafb;
}

.dark .schedule-cell.empty {
    background: #374151;
    color: #9ca3af;
}

.dark .time-cell {
    background: #374151;
    color: #d1d5db;
}

.dark .day-header,
.dark .time-header {
    background: #1f2937;
}