/* ========================================
   수업 스케줄 관리 페이지 CSS
   teacher-schedule.html
   ======================================== */

/* 페이지 레이아웃 */
.page-layout {
    flex: 1;
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 24px;
    gap: 24px;
}

/* 사이드바 */
.sidebar {
    width: 240px;
    flex-shrink: 0;
}

.sidebar-menu {
    background-color: #fff;
    border: 2px solid #5d4037;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar-title {
    padding: 16px 20px;
    font-weight: 600;
    border-bottom: 1px solid #5d4037;
    background-color: #5d4037;
    color: #fff;
}

.sidebar-menu a {
    display: block;
    padding: 14px 20px;
    color: #5d4037;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.sidebar-menu a:last-child {
    border-bottom: none;
}

.sidebar-menu a:hover {
    background-color: #faf8f5;
}

.sidebar-menu a.active {
    background-color: #efebe9;
    font-weight: 600;
}

/* 메인 컨텐츠 */
.main-content {
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

/* 캘린더 */
.calendar-container {
    background-color: #fff;
    border: 2px solid #5d4037;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #5d4037;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav button {
    padding: 8px 16px;
    background: none;
    border: 1px solid #5d4037;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-nav button:hover {
    background-color: #5d4037;
    color: #fff;
}

.calendar-title {
    font-size: 18px;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    background-color: #faf8f5;
    border-bottom: 1px solid #e0e0e0;
}

.calendar-day-header.sunday { color: #e53935; }
.calendar-day-header.saturday { color: #1976d2; }

.calendar-day {
    min-height: 120px;
    padding: 8px;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day:hover { background-color: #faf8f5; }
.calendar-day.other-month { background-color: #f5f5f5; color: #bdbdbd; }
.calendar-day.today { background-color: #fff3e0; }

.day-number {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.day-number.sunday { color: #e53935; }
.day-number.saturday { color: #1976d2; }

.day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-event {
    padding: 4px 6px;
    font-size: 11px;
    border-radius: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-event.lesson { background-color: #e8f5e9; color: #2e7d32; }
.day-event.pending { background-color: #fff3e0; color: #ef6c00; }
.day-event.available { background-color: #e3f2fd; color: #1565c0; }
.day-event.confirmed { background-color: #e8f5e9; color: #2e7d32; }
.day-event.live { background-color: #ffebee; color: #c62828; font-weight: 600; }
.day-event.scheduled { background-color: #fff8e1; color: #f57c00; }
.day-event.ready { background-color: #e8f5e9; color: #2e7d32; }

/* 수업 목록 */
.schedule-list {
    background-color: #fff;
    border: 2px solid #5d4037;
    border-radius: 8px;
}

.schedule-header {
    padding: 16px 24px;
    border-bottom: 1px solid #5d4037;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-title { font-size: 16px; font-weight: 600; }

.schedule-body { padding: 16px; }

.schedule-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #d7ccc8;
    border-radius: 8px;
    margin-bottom: 12px;
}

.schedule-item:last-child { margin-bottom: 0; }

.schedule-time {
    text-align: center;
    min-width: 100px;
}

.schedule-date { font-size: 12px; color: #8d6e63; }
.schedule-hour { font-size: 18px; font-weight: 600; }

.schedule-info { flex: 1; }
.schedule-student { font-weight: 600; }
.schedule-subject { font-size: 13px; color: #8d6e63; }

.schedule-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.schedule-status.confirmed { background-color: #e8f5e9; color: #2e7d32; }
.schedule-status.pending { background-color: #fff3e0; color: #ef6c00; }
.schedule-status.completed { background-color: #e0e0e0; color: #616161; }

.schedule-actions {
    display: flex;
    gap: 8px;
}

/* 수업 가능 시간 설정 */
.time-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.time-slot {
    padding: 10px;
    text-align: center;
    border: 1px solid #d7ccc8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.time-slot:hover { border-color: #5d4037; }
.time-slot.selected {
    background-color: #5d4037;
    color: #fff;
    border-color: #5d4037;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #8d6e63;
}

/* 모달 캘린더 */
.modal-calendar-container {
    border: 1px solid #d7ccc8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.modal-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #faf8f5;
    border-bottom: 1px solid #d7ccc8;
}

.modal-cal-nav {
    background: none;
    border: 1px solid #d7ccc8;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-cal-nav:hover {
    background: #5d4037;
    color: #fff;
    border-color: #5d4037;
}

.modal-cal-title {
    font-weight: 600;
    font-size: 14px;
}

.modal-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.modal-cal-day-header {
    padding: 6px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.modal-cal-day-header.sunday { color: #e53935; }
.modal-cal-day-header.saturday { color: #1976d2; }

.modal-cal-day {
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    cursor: pointer;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.modal-cal-day:nth-child(7n) {
    border-right: none;
}

.modal-cal-day:hover:not(.other-month):not(.past) {
    background: #efebe9;
}

.modal-cal-day.other-month {
    color: #ccc;
    cursor: default;
}

.modal-cal-day.past {
    color: #ccc;
    cursor: not-allowed;
    text-decoration: line-through;
}

.modal-cal-day.today {
    font-weight: 700;
    color: #5d4037;
}

.modal-cal-day.selected {
    background: #5d4037;
    color: #fff;
    font-weight: 600;
}

.modal-cal-day.sunday:not(.selected) { color: #e53935; }
.modal-cal-day.saturday:not(.selected) { color: #1976d2; }
.modal-cal-day.other-month.sunday,
.modal-cal-day.other-month.saturday,
.modal-cal-day.past.sunday,
.modal-cal-day.past.saturday { color: #ccc; }

.selected-dates-info {
    padding: 8px 16px;
    background: #faf8f5;
    border-top: 1px solid #d7ccc8;
    font-size: 12px;
    color: #5d4037;
}

.selected-dates-info span {
    font-weight: 600;
}

/* 모달 스타일 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 75vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal.modal-lg {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-desc {
    font-size: 13px;
    color: #8d6e63;
    margin-bottom: 20px;
    padding: 12px;
    background: #faf8f5;
    border-radius: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d7ccc8;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5d4037;
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* 버튼 스타일 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #5d4037;
    color: #fff;
}

.btn-primary:hover {
    background-color: #4e342e;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 토스트 */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 날짜별 수업 상세 카드 */
.day-detail-card {
    border: 1px solid #d7ccc8;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.day-detail-card:last-child {
    margin-bottom: 0;
}

.day-detail-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #faf8f5;
    border-bottom: 1px solid #d7ccc8;
}

.day-detail-subject {
    font-weight: 600;
    font-size: 15px;
    color: #5d4037;
}

.day-detail-course {
    font-size: 13px;
    color: #8d6e63;
}

.day-detail-card-body {
    padding: 16px;
}

.day-detail-row {
    display: flex;
    margin-bottom: 10px;
    font-size: 14px;
}

.day-detail-row:last-child {
    margin-bottom: 0;
}

.day-detail-label {
    width: 80px;
    color: #8d6e63;
    flex-shrink: 0;
}

.day-detail-value {
    color: #333;
    flex: 1;
}

.day-detail-description {
    margin-top: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.day-detail-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #faf8f5;
    border-top: 1px solid #d7ccc8;
}

.reservation-count {
    font-size: 13px;
    color: #8d6e63;
}

.reservation-count strong {
    color: #5d4037;
}

.btn-reserve {
    background: #1976d2;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reserve:hover {
    background: #1565c0;
}

.btn-reserve:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
}

.btn-cancel-reserve {
    background: #e53935;
    color: #fff;
}

.btn-cancel-reserve:hover {
    background: #c62828;
}

.day-detail-empty {
    text-align: center;
    padding: 40px 20px;
    color: #8d6e63;
}

.day-detail-empty p {
    margin: 0;
    font-size: 14px;
}

/* 수업 카드 액션 버튼 그룹 */
.day-detail-actions {
    display: flex;
    gap: 8px;
}

.btn-edit {
    background: #ff9800;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit:hover {
    background: #f57c00;
}

.btn-delete {
    background: #e53935;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #c62828;
}

/* 수업계획 상태 스타일 */
.schedule-status.available {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* 반응형 */
@media (max-width: 768px) {
    .page-layout {
        flex-direction: column;
        padding: 16px;
    }

    .sidebar {
        width: 100%;
    }

    .calendar-day { min-height: 80px; }
    .time-slots { grid-template-columns: repeat(2, 1fr); }
}
