/* ==================== 모달 스타일 ==================== */
/* 통합된 모달 스타일 - styles.css와 modal.css의 중복 제거 */

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

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* 학교 추가 모달 - 넓은 버전 */
#addSchoolModal .modal-content {
    width: 800px;
    max-width: 90vw;
}

/* 진도교재 일괄생성 모달 - 넓은 버전 */
#curriculumModal .modal-content {
    width: 1400px;
    max-width: 95vw;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#curriculumModal .modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* 단위 선택 라디오 버튼 스타일 */
#curriculumModal label[for*="curriculumUnit"],
#curriculumModal label:has(input[name="curriculumUnit"]) {
    transition: all 0.2s;
}

#curriculumModal label:has(input[name="curriculumUnit"]:checked) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

#curriculumModal label:has(input[name="curriculumUnit"]:not(:checked)):hover {
    border-color: var(--primary);
    background: var(--surface);
}

/* 헤더 선택 라디오 버튼 스타일 */
#curriculumModal label:has(input[name="curriculumHeader"]:checked) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

#curriculumModal label:has(input[name="curriculumHeader"]:not(:checked)):hover {
    border-color: var(--primary);
    background: var(--surface);
}

/* 배수 선택 라디오 버튼 스타일 */
#curriculumModal label:has(input[name="curriculumMultiplier"]:checked) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

#curriculumModal label:has(input[name="curriculumMultiplier"]:not(:checked)):hover {
    border-color: var(--primary);
    background: var(--surface);
}

/* 교재 추가 모달 라디오 버튼 스타일 */
#addTextbookModal label:has(input[type="radio"]:checked) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

#addTextbookModal label:has(input[type="radio"]:not(:checked)):hover {
    border-color: var(--primary);
    background: var(--surface-muted);
}

/* 교재 목록 필터 버튼 스타일 */
.textbook-filter-btn.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    font-weight: 600;
}

.textbook-filter-btn:hover:not(.active) {
    border-color: var(--primary);
    background: var(--surface-muted);
}

/* 교재 편집 화면 라디오 버튼 스타일 */
#textbookEditMode label:has(input[type="radio"]:checked) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

#textbookEditMode label:has(input[type="radio"]:not(:checked)):hover {
    border-color: var(--primary);
    background: var(--surface-muted);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    position: relative;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.cancel {
    background: var(--surface-muted);
    color: var(--text);
}

.modal-btn.cancel:hover {
    background: var(--border);
}

.modal-btn.confirm {
    background: var(--primary);
    color: white;
}

.modal-btn.confirm:hover {
    background: var(--primary-dark);
}

/* ==================== 색상 팔레트 ==================== */
.color-palette {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.color-option {
    width: 38px;
    height: 38px;
    border-radius: 5px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.color-option:hover {
    transform: scale(1.08);
}

.color-option.selected {
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(106, 59, 255, 0.5);
}

/* Confirm Modal */
.confirm-modal {
    text-align: center;
    max-width: 440px;
}

.confirm-icon {
    font-size: 60px;
    margin-bottom: 18px;
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.confirm-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 13px;
}

.confirm-message {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 9px;
    line-height: 1.6;
}

.confirm-detail {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 18px;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
    padding: 9px;
    background: var(--bg);
    border-radius: 8px;
}

.confirm-detail:empty {
    display: none;
}

/* ==================== 보고서 출력 모달 ==================== */
.print-mode-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.print-mode-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.print-mode-option:hover {
    border-color: var(--primary);
    background: var(--surface-muted);
}

.print-mode-option input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin: 0;
}

.print-mode-option input[type="radio"]:checked + .print-mode-content .print-mode-title {
    color: var(--primary);
}

.print-mode-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    align-items: center;
}

.print-mode-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    transition: color 0.2s;
}

.print-mode-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.report-month-list {
    max-height: 400px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 4px;
}

.report-month-list::-webkit-scrollbar {
    width: 8px;
}

.report-month-list::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

.report-month-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.report-month-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.report-batch-month-item {
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-batch-month-item:hover {
    border-color: var(--primary);
    background: var(--surface-muted);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.report-batch-month-item > div {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}