/* css/survey.css */

/* =========================================================
   1. 공통 및 전체 레이아웃 (Global & Container)
========================================================= */
body { background-color: #f8fafc; font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif; }
.survey-container { max-width: 850px; margin: 40px auto; padding: 0 20px 60px; }
.survey-header { text-align: center; margin-bottom: 35px; }
.survey-header h1 { color: #1e293b; margin-bottom: 10px; font-size: 1.8rem; letter-spacing: -0.5px; }
.survey-header p { color: #64748b; font-size: 0.95rem; line-height: 1.6; }
.section-title { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #f1f5f9; padding-bottom: 15px; margin-bottom: 30px; }
.section-title h3 { margin: 0; font-size: 1.25rem; color: #1e293b; }

/* =========================================================
   2. 탭 메뉴 및 컨텐츠 (Tabs & Contents)
========================================================= */
.survey-tabs { display: flex; background: white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); overflow: hidden; margin-bottom: 30px; }
.tab-btn { flex: 1; padding: 20px; border: none; background: white; font-size: 1.05rem; font-weight: 600; color: #94a3b8; cursor: pointer; transition: all 0.2s; border-bottom: 3px solid transparent; }
.tab-btn.active { color: #2563EB; background: #eff6ff; border-bottom-color: #2563EB; }
.tab-btn:hover:not(.active) { background: #f8fafc; color: #64748b; }
.tab-content { display: none; background: white; padding: 40px; border-radius: 16px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01); }
.tab-content.active { display: block; animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   3. 텍스트 요소 및 폼 입력 (Texts & Form Inputs)
========================================================= */
.required-note { font-size: 0.85rem; color: #ef4444; background: #fef2f2; padding: 4px 8px; border-radius: 4px; }
.req { color: #ef4444; margin-left: 2px; }
.notice-box { background-color: #fffbeb; color: #b45309; padding: 15px; border-radius: 8px; border-left: 4px solid #f59e0b; margin-bottom: 20px; font-size: 0.95rem; line-height: 1.5; word-break: keep-all; }
.guide-text { background-color: #f0f9ff; color: #0369a1; padding: 15px; border-radius: 8px; border-left: 4px solid #0ea5e9; margin-bottom: 25px; font-size: 0.95rem; line-height: 1.5; word-break: keep-all; }
.warning-text { color: #ef4444; font-size: 0.85rem; font-weight: 600; margin-top: -5px; margin-bottom: 15px; background: #fff1f2; padding: 8px; border-radius: 6px; display: inline-block; }
.input-label { display: block; font-weight: 700; margin-top: 25px; margin-bottom: 8px; color: #334155; font-size: 0.95rem; }
.form-section { margin-top: 40px; padding-top: 25px; border-top: 1px dashed #cbd5e1; }
.form-section h4 { color: #2563EB; margin-bottom: 15px; font-size: 1.1rem; }
input[type="text"], input[type="number"], select, textarea { width: 100%; padding: 12px 15px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; font-size: 1rem; margin-bottom: 12px; transition: border-color 0.2s, box-shadow 0.2s; background-color: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.radio-group { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: 15px; }
.radio-group label { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 10px 15px; border: 1px solid #e2e8f0; border-radius: 8px; transition: all 0.2s; }
.radio-group label:hover { background-color: #f8fafc; border-color: #cbd5e1; }
.radio-group input[type="radio"] { width: auto; margin: 0; }
.hidden-input { display: none; }
.readonly-input { background-color: #f1f5f9 !important; color: #64748b; font-weight: 600; cursor: default; }
.readonly-input:focus { border-color: transparent !important; box-shadow: none !important; }

/* =========================================================
   4. 성적 입력 테이블 요소 (Score Tables)
========================================================= */
.exam-selector { background: #f8fafc; padding: 20px; border-radius: 10px; border: 1px solid #e2e8f0; margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }
.exam-selector label { font-weight: bold; color: #334155; }
.exam-selector select { width: auto; min-width: 200px; margin-bottom: 0; border-color: #94a3b8; }
.table-responsive { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,0.03); }
.score-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.score-table th { background: #f1f5f9; padding: 14px; border-bottom: 2px solid #cbd5e1; border-right: 1px solid #e2e8f0; color: #475569; font-weight: 700; font-size: 0.9rem; text-align: center; }
.score-table th:last-child { border-right: none; }
.score-table td { padding: 8px; border-bottom: 1px solid #e2e8f0; border-right: 1px solid #f1f5f9; height: 55px; vertical-align: middle; }
.score-table td:last-child { border-right: none; }
.score-table tr:last-child td { border-bottom: none; }
.score-table td:first-child { background: #f8fafc; font-weight: 700; color: #334155; width: 80px; text-align: center; border-right: 1px solid #e2e8f0; }
.score-table input, .score-table select { width: 100%; height: 38px; margin: 0; padding: 0 10px; border: 1px solid transparent; background: transparent; text-align: center; font-size: 1rem; border-radius: 6px; transition: all 0.2s; }
.score-table input:focus, .score-table select:focus { background: white; border-color: #2563EB; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1); }
.score-table select { text-align-last: center; cursor: pointer; }
.disabled-cell { background-color: #f8fafc; background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 50%, #f1f5f9 50%, #f1f5f9 75%, transparent 75%, transparent); background-size: 10px 10px; }

@media (min-width: 769px) {
    .score-table th:nth-child(1), .score-table td:nth-child(1) { width: 10%; }
    .score-table th:nth-child(2), .score-table td:nth-child(2) { width: 26%; }
    .score-table th:nth-child(3), .score-table td:nth-child(3) { width: 16%; }
    .score-table th:nth-child(4), .score-table td:nth-child(4) { width: 16%; }
    .score-table th:nth-child(5), .score-table td:nth-child(5) { width: 16%; }
    .score-table th:nth-child(6), .score-table td:nth-child(6) { width: 16%; }
    .score-table input, .score-table select { height: 42px; line-height: 42px; padding: 0; margin: 0; display: block; box-sizing: border-box; }
}
.score-table input[type="number"]::-webkit-outer-spin-button, .score-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-table input[type="number"] { -moz-appearance: textfield; }

/* =========================================================
   5. 버튼 및 모달/약관 (Buttons & Modals)
========================================================= */
.save-btn { display: block; width: 100%; padding: 18px; margin-top: 40px; background-color: #2563EB; color: white; border: none; border-radius: 10px; font-size: 1.15rem; font-weight: 700; cursor: pointer; transition: background 0.3s, transform 0.2s; box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2); }
.save-btn:hover { background-color: #1d4ed8; transform: translateY(-2px); }
.save-btn:disabled { background-color: #cbd5e1; cursor: not-allowed; transform: none; box-shadow: none; color: #64748b; }
.consent-box { display: flex; justify-content: space-between; align-items: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px 20px; margin: 25px 0; }
.consent-label { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.consent-label input[type="checkbox"] { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.consent-text { font-size: 0.95rem; color: #1e293b; font-weight: 600; }
.consent-link { font-size: 0.8rem; color: #64748b; text-decoration: underline; cursor: pointer; white-space: nowrap; margin-left: auto; }
.consent-link:hover { color: #2563eb; }
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; justify-content: center; align-items: center; }
.modal.hidden { display: none !important; }
.term-modal-content { background: white; padding: 25px; border-radius: 12px; width: 550px; max-width: 90%; position: relative; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 10px 25px rgba(0,0,0,0.1); text-align: left; }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; cursor: pointer; color: #94a3b8; line-height: 1; }
.close-btn:hover { color: #ef4444; }
.term-text-box { flex: 1; overflow-y: auto; background: #f1f5f9; padding: 15px; border-radius: 8px; font-size: 0.85rem; line-height: 1.6; color: #334155; white-space: pre-wrap; border: 1px solid #cbd5e1; }

/* =========================================================
   6. 모바일 반응형 (Mobile Media Query)
========================================================= */
@media (max-width: 768px) {
    .survey-container { padding: 0 15px 40px; margin-top: 20px; }
    .tab-content { padding: 25px 15px; }
    .tab-btn { padding: 15px 5px; font-size: 0.95rem; }
    .section-title { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
    .section-title h3 { margin: 0; }
    .exam-selector { flex-direction: column; align-items: flex-start; gap: 10px; }
    .exam-selector select { width: 100%; }
    input, select, textarea { font-size: 16px !important; }
    .table-responsive { border: none; box-shadow: none; background: transparent; overflow-x: visible; }
    .score-table { min-width: 0; width: 100%; }
    .score-table thead { display: none; }
    .score-table, .score-table tbody, .score-table tr, .score-table td { display: block; width: 100%; box-sizing: border-box; }
    .score-table tr { margin-bottom: 25px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
    .score-table td { display: flex; align-items: center; justify-content: space-between; border: none !important; border-bottom: 1px solid #f1f5f9 !important; padding: 12px 15px !important; height: auto; gap: 10px; }
    .score-table td:last-child { border-bottom: none !important; }
    .score-table td:first-child { background: #f8fafc; justify-content: center; font-size: 1.1rem; font-weight: 700; color: #1e293b; padding: 15px !important; border-bottom: 1px solid #e2e8f0 !important; }
    .score-table td:not(:first-child)::before { content: attr(data-label); font-weight: 600; color: #475569; font-size: 0.95rem; flex-shrink: 0; }
    .score-table input, .score-table select { width: 100%; max-width: 140px; text-align: right; text-align-last: right; border: 1px solid #e2e8f0; background-color: #fff; border-radius: 6px; padding: 0 10px; height: 40px; box-sizing: border-box; }
    .score-table input.readonly-input { background-color: #f8fafc; border-color: transparent; color: #64748b; }
    .disabled-cell { display: none !important; }
}