/* ============================================
 * history.css - 응시 기록 페이지 스타일
 * ============================================
 * 이 파일을 고치면 영향받는 곳:
 *   → history.html (유일한 소비자)
 *
 * 이 파일이 의존하는 곳:
 *   ← css/common.css (CSS 변수: --header-bg, --action-color, --sub-action-color,
 *      --card-bg, --page-bg, --text-color)
 * ============================================ */

.container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.page-title {
    text-align: center;
    font-size: 26px;
    color: var(--header-bg);
    margin-bottom: 6px;
}

.page-sub {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 30px;
}

/* 로그인 안내 */
.login-prompt {
    text-align: center;
    padding: 80px 20px;
    color: #888;
    font-size: 16px;
}
.login-prompt button {
    margin-top: 16px;
    padding: 10px 28px;
    background: var(--action-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
}

/* 요약 바 */
.summary-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.summary-box {
    flex: 1;
    min-width: 100px;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.summary-num { font-size: 28px; font-weight: 700; }
.summary-num.green { color: #2D7D46; }
.summary-num.red { color: #dc2626; }
.summary-num.blue { color: var(--action-color); }
.summary-label { font-size: 12px; color: #888; margin-top: 4px; }

/* 기록 카드 */
.history-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.history-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.history-card.active { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

.hc-head {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 14px;
}

.hc-score {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.hc-score.pass { background: #2D7D46; }
.hc-score.fail { background: #dc2626; }

.hc-info { flex: 1; min-width: 0; }
.hc-subject { font-weight: 700; font-size: 15px; }
.hc-meta { font-size: 12px; color: #888; margin-top: 3px; }

.hc-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.hc-badge.pass { background: #dcfce7; color: #166534; }
.hc-badge.fail { background: #fee2e2; color: #991b1b; }
.hc-badge.retry { background: #e0e7ff; color: #3730a3; }
.hc-score.retry { color: #3730a3; }

.hc-arrow {
    color: #ccc;
    font-size: 14px;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.history-card.active .hc-arrow { transform: rotate(90deg); }

/* 상세 리뷰 (접히는 영역) */
.hc-detail {
    display: none;
    border-top: 1px solid #eee;
    padding: 16px 20px;
}
.history-card.active .hc-detail { display: block; }

/* 필터 버튼 */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.filter-btn {
    padding: 6px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    color: #666;
}
.filter-btn.active {
    background: var(--action-color);
    color: #fff;
    border-color: var(--action-color);
}

/* 문제 리뷰 아이템 */
.rv-item {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    border-left: 4px solid #ddd;
}
.rv-item.correct { border-left-color: #2D7D46; background: #f0fdf4; }
.rv-item.wrong { border-left-color: #dc2626; background: #fef2f2; }

.rv-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.rv-num { font-weight: 700; }
.rv-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
}
.rv-badge.correct { background: #bbf7d0; color: #166534; }
.rv-badge.wrong { background: #fecaca; color: #991b1b; }

.rv-text { color: #444; line-height: 1.5; }

.rv-answer {
    font-size: 12px;
    margin-top: 4px;
    color: #666;
}
.rv-answer .my { font-weight: 600; }
.rv-answer .correct-ans { color: #2D7D46; font-weight: 600; }

.rv-img { margin: 6px 0; }
.rv-img img { max-width: 100%; max-height: 180px; border-radius: 6px; border: 1px solid #ddd; }

.rv-choices { margin-top: 6px; }
.rv-choice {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 2px;
}
.rv-choice.is-answer { background: #dcfce7; font-weight: 600; }
.rv-choice.is-wrong { background: #fee2e2; text-decoration: line-through; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
    font-size: 15px;
}

.cmt-reply-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 3px 10px;
    font-size: 11px;
    color: var(--action-color);
    background: none;
    border: 1px solid var(--action-color);
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}
.cmt-reply-btn:hover { background: var(--action-color); color: #fff; }
.cmt-reply-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 나이트 모드 (history 전용) */
body.night-mode .history-card { background: #1E1E1E; }
body.night-mode .history-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
body.night-mode .hc-detail { border-top-color: #333; }
body.night-mode .hc-meta { color: #999; }
body.night-mode .hc-arrow { color: #666; }
body.night-mode .summary-box { background: #1E1E1E; }
body.night-mode .summary-label { color: #999; }
body.night-mode .page-title { color: #E0E0E0; }
body.night-mode .filter-btn { background: #1E1E1E; color: #ccc; border-color: #444; }
body.night-mode .rv-item.correct { background: #0d2818; border-left-color: #2D7D46; }
body.night-mode .rv-item.wrong { background: #2a1010; border-left-color: #dc2626; }
body.night-mode .rv-text { color: #ddd; }
body.night-mode .rv-choice { color: #ccc; }
body.night-mode .rv-choice.is-answer { background: #0d3318; }
body.night-mode .rv-choice.is-wrong { background: #3a1515; }
body.night-mode .rv-answer { color: #bbb; }

/* 반응형 (history 전용) */
@media (max-width: 600px) {
    .container { padding: 0 12px; margin-top: 20px; }
    .page-title { font-size: 22px; }
    .dot-figure { width: 56px; height: 56px; }
    .hc-head { padding: 12px 14px; }
    .summary-box { padding: 12px; }
    .summary-num { font-size: 22px; }
}
