/* 전체 스타일 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
}

footer {
    margin-top: auto;
}

/* 네비게이션 바 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

/* 카드 스타일 */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-header {
    font-weight: bold;
    border: none;
}

/* 질문 컨테이너 */
#questionContainer {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 평가 컨테이너 */
#evaluationContainer {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 텍스트 영역 */
textarea.form-control {
    font-family: 'Courier New', monospace;
    border: 2px solid #dee2e6;
    transition: border-color 0.3s;
}

textarea.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 버튼 스타일 */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #198754;
}

.btn-success:hover {
    background-color: #157347;
    transform: translateY(-1px);
}

/* Jumbotron 스타일 */
.jumbotron {
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.jumbotron h1 {
    font-weight: bold;
}

.jumbotron .btn {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
}

/* 선택 메시지 */
#noSelectionMsg {
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .container {
        padding: 0 10px;
    }

    textarea.form-control {
        font-size: 16px; /* iOS에서 줌 방지 */
    }
}

/* 평가 결과 스타일 */
.evaluation-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.evaluation-item:last-child {
    border-bottom: none;
}

.evaluation-score {
    display: inline-block;
    background-color: #0d6efd;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: bold;
    margin-right: 10px;
}

.evaluation-title {
    font-weight: bold;
    color: #333;
    margin: 0.5rem 0;
}

.evaluation-content {
    color: #666;
    line-height: 1.8;
}

/* 알림 스타일 */
.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 2rem;
}

.alert-info {
    background-color: #e7f3ff;
    color: #004085;
}

/* 문제 영역 */
.question-box {
    border-left: 4px solid #0d6efd;
    font-size: 1.05rem;
    line-height: 1.8;
}

.question-preview {
    font-size: 0.9rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 답안 텍스트 영역 */
.answer-area {
    font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    border: 2px solid #dee2e6;
    transition: border-color 0.3s;
}

.answer-area:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* AI 평가 결과 */
.eval-card {
    border: 2px solid #198754;
}

.eval-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #e9ecef;
}

.eval-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.eval-title {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.eval-score-bar {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, #d4edda, #f8f9fa);
    border-radius: 6px;
}

.eval-section ul, .eval-section ol {
    padding-left: 1.5rem;
    margin-bottom: 0;
    line-height: 1.8;
}

.eval-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.eval-section table th,
.eval-section table td {
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
}

.eval-section table th {
    background: #e9ecef;
    font-weight: bold;
}

/* 멘토 피드백 */
.mentor-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #e9ecef;
}

.mentor-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mentor-title {
    font-weight: bold;
    font-size: 1rem;
    color: #155724;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: #d4edda;
    border-radius: 4px;
}

.mentor-section ul {
    padding-left: 1.5rem;
    margin-bottom: 0;
    line-height: 1.8;
}

/* 예상문제 */
.predict-question {
    padding: 1rem;
}

.predict-badge {
    display: inline-block;
    background: #ffc107;
    color: #333;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.predict-text {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #fff3cd;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
}

.predict-hint {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.8;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

/* ===== 타이머 ===== */
.exam-timer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: #212529;
    color: #fff;
    border-radius: 8px;
    flex-wrap: wrap;
}

.timer-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.timer-display {
    font-size: 1.8rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    min-width: 90px;
}

.exam-timer.timer-warning .timer-display { color: #ffc107; }
.exam-timer.timer-danger  .timer-display { color: #dc3545; animation: blink 1s infinite; }
.exam-timer.timer-done    .timer-display { color: #6c757d; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ===== 홈 대시보드 ===== */
.hero-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 16px;
}

.hero-title {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.3;
}

.hero-sub {
    font-size: 1.2rem;
    color: #a8d8ea;
    display: block;
}

.hero-desc {
    color: #ccc;
    margin: 1rem 0 1.5rem;
    line-height: 1.8;
}

.hero-badge-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.hero-badge {
    background: rgba(255,255,255,0.15);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
}

.section-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.dash-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: 100%;
}

.dash-num {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.dash-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.4rem;
}

.quick-card {
    background: white;
    border-radius: 10px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.quick-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.quick-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.quick-title { font-weight: bold; font-size: 1.1rem; margin-bottom: 0.5rem; }
.quick-desc { font-size: 0.85rem; color: #6c757d; line-height: 1.6; }

.recent-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.4rem;
    background: white;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.85rem;
}

.recent-item:hover { background: #f0f4ff; }
.recent-preview { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #444; }
.recent-date { font-size: 0.75rem; color: #999; margin-left: 0.5rem; flex-shrink: 0; }

/* 시험 안내 카드 */
.exam-info-card {
    text-align: center;
    padding: 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    height: 100%;
}

.exam-info-title { font-size: 1.1rem; font-weight: bold; color: #0d6efd; }
.exam-info-type  { font-size: 0.85rem; color: #6c757d; margin: 0.25rem 0 0.5rem; }
.exam-info-desc  { font-size: 0.82rem; color: #555; line-height: 1.7; }

/* ===== 학습 기록 ===== */
.history-card { transition: box-shadow 0.2s; }
.history-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.history-preview { font-size: 0.9rem; color: #444; }

.stat-num   { font-size: 2rem; font-weight: bold; }
.stat-label { font-size: 0.8rem; color: #6c757d; margin-top: 0.4rem; }

/* ===== 즐겨찾기 별 ===== */
.fav-star {
    cursor: pointer;
    font-size: 1.1rem;
    color: #aaa;
    transition: color 0.2s, transform 0.15s;
    user-select: none;
    background: none;
    border: none;
    padding: 0;
}

.fav-star:hover  { color: #ffc107; transform: scale(1.2); }
.fav-star.active { color: #ffc107; }

/* ===== 검색 페이지 ===== */
.search-result-card {
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.search-result-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }

.search-highlight {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #333;
}

.search-highlight mark {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

.search-tag { font-size: 0.8rem; }

/* ===== 모범답안 ===== */
.model-answer { line-height: 1.8; }

.ma-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #e9ecef;
}

.ma-section:last-child { border-bottom: none; margin-bottom: 0; }

.ma-title {
    font-weight: bold;
    color: #0a58ca;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.75rem;
    background: #e7f1ff;
    border-radius: 4px;
    border-left: 3px solid #0d6efd;
}

.ma-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.88rem;
}

.ma-section table th,
.ma-section table td {
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    vertical-align: top;
}

.ma-section table th {
    background: #e9ecef;
    font-weight: bold;
    text-align: center;
}

.ma-section ul, .ma-section ol {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.ma-section li { margin-bottom: 0.3rem; }

/* ===== 출제 경향 통계 ===== */
.heatmap-table { font-size: 0.8rem; }
.heatmap-table .hm-label {
    font-weight: bold;
    white-space: nowrap;
    background: #f8f9fa;
    padding: 6px 10px;
    min-width: 110px;
}
.heatmap-table .hm-year {
    text-align: center;
    font-weight: bold;
    background: #e9ecef;
    padding: 6px 4px;
    min-width: 46px;
}
.heatmap-table .hm-cell {
    text-align: center;
    padding: 6px 4px;
    font-weight: bold;
    transition: filter 0.15s;
}
.heatmap-table .hm-cell:hover { filter: brightness(0.85); }

/* 학습 전략 카드 */
.strategy-card {
    border: 2px solid;
    border-radius: 10px;
    padding: 1.25rem;
    height: 100%;
}
.strategy-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.strategy-desc {
    font-size: 0.82rem;
    color: #666;
    margin-bottom: 0.75rem;
}
.strategy-card ul {
    padding-left: 1.25rem;
    margin: 0;
    line-height: 1.9;
}

/* ===== 4단계 학습 플로우 ===== */
.step-flow {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: white;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.step-item {
    text-align: center;
    padding: 0.6rem 1rem;
    flex: 1;
    min-width: 130px;
}
.step-num {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}
.step-label { font-weight: 600; font-size: 0.88rem; color: #333; }
.step-sub   { font-size: 0.75rem; color: #888; margin-top: 0.15rem; }
.step-arrow {
    font-size: 2rem;
    color: #ced4da;
    display: flex;
    align-items: center;
    padding-bottom: 4px;
    line-height: 1;
}
@media (max-width: 576px) {
    .step-arrow { display: none; }
    .step-item  { min-width: 45%; }
}

/* ===== 처음 방문자 온보딩 ===== */
.onboard-card { background: linear-gradient(135deg, #f0f7ff 0%, #fefce8 100%); }
.onboard-circle {
    display: inline-flex;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(13,110,253,0.25);
}

/* ===== AI 채점 기준 카드 ===== */
.eval-criteria-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem 0.5rem;
    height: 100%;
}
.eval-criteria-pct {
    font-size: 1.6rem;
    font-weight: bold;
    line-height: 1.2;
}
.eval-criteria-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0.25rem 0;
    color: #333;
}
