/* --- 기본 HTML 및 Body 설정 --- */
html {
    font-size: 16px; /* rem 단위의 기준이 되는 폰트 크기 설정 */
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 0; /* body의 패딩을 제거하여 헤더가 상단에 붙도록 함 */
    /* 모바일에서 폰트 크기 자동 조정을 방지하여 일관성 유지 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.container {
    max-width: 800px;
    margin: 2rem auto; /* 상단 헤더와의 간격 확보 */
    background-color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

h1 { text-align: center; color: #2c3e50; }

/* --- [수정] 헤더 스타일 --- */
.main-header {
    display: flex;
    justify-content: space-between; /* 로고와 네비게이션을 양쪽 끝으로 분리 */
    align-items: center;
    padding: 10px 20px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem; /* container와의 간격을 약간 줄임 */
}
.logo {
    font-weight: bold;
    font-size: 1.2rem;
    color: #2c3e50;
    text-decoration: none;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}
.main-nav a {
    text-decoration: none;
    color: #3498db;
    font-weight: bold;
    font-size: 0.9rem;
}
.main-nav span {
    font-size: 0.9rem;
    color: #333;
}

/* --- index.html --- */
.subject-list { margin-top: 2rem; display: grid; grid-template-columns: 1fr; gap: 1rem; }
.subject-card { display: flex; justify-content: space-between; align-items: center; background-color: #3498db; color: white; padding: 1.25rem; border-radius: 8px; text-decoration: none; font-size: 1.1rem; font-weight: bold; transition: all 0.2s; }
.subject-card:hover { transform: translateY(-5px); box-shadow: 0 6px 15px rgba(0,0,0,0.15); background-color: #2980b9; }
.subject-score { font-size: 0.9rem; background-color: rgba(255,255,255,0.2); padding: 0.3rem 0.6rem; border-radius: 5px; }
.review-section { margin-top: 1.5rem; }
.review-card { width: 100%; background-color: #2ecc71; color: white; padding: 1.25rem; border-radius: 8px; text-decoration: none; text-align: center; font-size: 1.1rem; font-weight: bold; transition: all 0.2s; border: none; cursor: pointer; }
.review-card:hover { background-color: #27ae60; }

/* --- quiz.html --- */
.quiz-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 1rem; margin-bottom: 1.5rem; }
.quiz-header a { text-decoration: none; color: #3498db; font-weight: bold; }
#timer { font-size: 1.5rem; font-weight: bold; color: #e74c3c; }
.question-text { font-size: 1.1rem; line-height: 1.7; white-space: pre-wrap; margin-bottom: 1.5rem; }
.question-text .question-choice {
    font-size: 0.95rem; /* 기본 폰트보다 약간 작게 설정 (원하는 크기로 조절) */
    margin-left: 1rem;  /* 살짝 들여쓰기 효과 (선택사항) */
    text-indent: -1rem; /* 들여쓰기 후 첫 줄을 다시 내어쓰기 (선택사항) */
}
.options-list { list-style: none; padding: 0; margin: 0; }
.option-item { padding: 0.8rem 1rem; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 0.7rem; cursor: pointer; transition: all 0.2s; display: flex; justify-content: space-between; align-items: center; font-size: 1rem; }
.option-item:hover { background-color: #f0f0f0; }
.option-item.selected { background-color: #dbeafe; border-color: #60a5fa; }
.quiz-navigation { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.quiz-navigation button, .home-btn-quiz { padding: 0.6rem 1.2rem; border: none; background-color: #95a5a6; color: white; border-radius: 5px; cursor: pointer; font-size: 1rem; text-decoration: none; }
#prev-btn, #next-btn { background-color: #3498db; }
#submit-btn { background-color: #2ecc71; }
#progress { font-size: 1.1rem; font-weight: bold; color: #7f8c8d; }

/* --- 오답노트 & 결과 페이지 공통 스타일 --- */
.option-item.correct, .correct-answer { background-color: #e8f5e9 !important; border-color: #a5d6a7 !important; color: #2e7d32; font-weight: bold; }
.option-item.incorrect, .incorrect-selection { background-color: #ffebee !important; border-color: #ef9a9a !important; color: #c62828; text-decoration: line-through; }
.feedback { font-weight: bold; font-size: 1.2rem; }
.source-text { font-size: 0.9rem; color: #888; text-align: right; margin-top: 1rem; font-style: italic; }

/* --- mypage.html --- */
.profile-section { background-color: #f9f9f9; padding: 1.5rem; border-radius: 8px; margin-bottom: 2rem; }
.profile-section p { margin: 0 0 1rem; font-size: 1.2rem; }
#nickname-display a { text-decoration: none; }
.nickname-form { display: flex; gap: 10px; }
.nickname-form input { flex-grow: 1; padding: 0.6rem; border: 1px solid #ccc; border-radius: 5px; font-size: 1rem; }
.nickname-form button { padding: 0.6rem 1rem; border: none; color: white; border-radius: 5px; cursor: pointer; font-weight: bold; }
.nickname-form button[type="submit"] { background-color: #27ae60; }
.nickname-form button[type="button"] { background-color: #95a5a6; }

/* --- 캘린더 스타일 --- */
.fc-toolbar-title { font-size: 1.5em !important; }
.fc .fc-toolbar.fc-header-toolbar {
    display: flex;
    flex-direction: column;
}
.fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 10px;
}
.fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:nth-child(1) { order: 2; } /* prev,next today */
.fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:nth-child(2) { order: 1; } /* title */
.fc .fc-toolbar.fc-header-toolbar .fc-toolbar-chunk:nth-child(3) { order: 3; } /* right */

/* [추가] 모바일 화면에서 캘린더 폰트 크기 조절 */
@media (max-width: 600px) {
    .fc .fc-col-header-cell-cushion, /* 요일 (일, 월, 화...) */
    .fc .fc-daygrid-day-number {   /* 날짜 (1, 2, 3...) */
        font-size: 0.8rem;
        padding: 2px;
    }
    .fc .fc-toolbar-title {
        font-size: 1.2em !important;
    }
    .fc .fc-daygrid-event-harness {
        font-size: 0.7rem; /* 이벤트 텍스트 크기 */
    }
}

/* --- 캘린더 기록 팝업(모달) 스타일 --- */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: #fefefe; margin: 15% auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 500px; border-radius: 10px; position: relative; }
.close-button { color: #aaa; float: right; font-size: 28px; font-weight: bold; }
.close-button:hover, .close-button:focus { color: black; text-decoration: none; cursor: pointer; }
#modal-body button { width: 100%; padding: 10px; margin-top: 1rem; background-color: #e74c3c; color: white; border: none; border-radius: 5px; font-size: 1rem; cursor: pointer; }

/* --- result.html --- */
.result-summary { display: flex; justify-content: space-around; text-align: center; background-color: #ecf0f1; padding: 1.5rem; border-radius: 8px; margin-bottom: 2rem; }
.summary-item h2 { margin: 0 0 0.5rem; font-size: 1.1rem; color: #7f8c8d; }
.summary-item p { font-size: 2rem; font-weight: bold; color: #2c3e50; margin: 0; }
.result-block { border: 2px solid #ddd; margin-bottom: 1.5rem; padding: 1.5rem; border-radius: 8px; }
.correct-bg { border-color: #c8e6c9; }
.incorrect-bg { border-color: #ffcdd2; }
.option-item-result { padding: 0.5rem 0.8rem; border-radius: 5px; margin-bottom: 0.4rem; }
.home-btn { display: block; width: 100%; padding: 1rem; box-sizing: border-box; margin-top: 2rem; background-color: #3498db; color: white; text-align: center; text-decoration: none; border-radius: 5px; font-size: 1.0rem; }

footer { text-align: center; margin-top: 2.5rem; padding: 1.5rem; border-top: 1px solid #e0e0e0; font-size: 0.8rem; color: #777; }
.footer-links, .footer-downloads { margin-bottom: 1rem; }
.footer-links a, .footer-downloads a { color: #3498db; text-decoration: none; margin: 0 10px; }
