/* HRD-Net 사전역량평가 스타일시트 */

/* 전역 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    padding: 20px 10px;
    line-height: 1.6;
}

#wrap {
    max-width: 840px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* 헤더 영역 */
.header-logo {
    background: white;
    padding: 24px 20px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
}

.header-logo img {
    max-width: 280px;
    height: auto;
}

/* 폼 컨테이너 */
.form-container {
    padding: 32px 24px;
}

/* 질문 섹션 */
.question-section {
    margin-bottom: 32px;
}

.question-section:last-child {
    margin-bottom: 0;
}

.question-header {
    background: #f8f9fa;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
    font-size: 15px;
    font-weight: 500;
    color: #212529;
    border: 1px solid #e9ecef;
    border-bottom: none;
}

.question-subtext {
    display: block;
    font-size: 13px;
    color: #6c757d;
    font-weight: 400;
    margin-top: 4px;
}

/* 옵션 컨테이너 */
.options-container {
    background: white;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 라디오/체크박스 옵션 */
.option-item {
    position: relative;
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option-label {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    border: 1.5px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.option-label:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.option-item input[type="radio"]:checked ~ .option-label {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
    font-weight: 500;
}

.option-item input[type="checkbox"]:checked ~ .option-label {
    background: #198754;
    color: white;
    border-color: #198754;
}

/* 사전역량평가 섹션 */
.assessment-container {
    margin: 40px 0;
    padding: 32px 24px;
    background: #fafbfc;
    border-radius: 8px;
}

.section-header {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0066cc;
}

.section-description {
    font-size: 14px;
    color: #6c757d;
    font-weight: 400;
}

/* 리커트 척도 스타일 */
.likert-question {
    margin-bottom: 24px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.likert-question-text {
    padding: 16px 20px;
    background: #f8f9fa;
    font-size: 15px;
    color: #212529;
    border-bottom: 1px solid #e9ecef;
}

.question-badge {
    display: inline-block;
    background: #0066cc;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    text-align: center;
    line-height: 24px;
    margin-right: 8px;
    font-size: 13px;
    font-weight: 600;
}

.likert-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: white;
}

.likert-item {
    position: relative;
    border-right: 1px solid #f1f3f5;
}

.likert-item:last-child {
    border-right: none;
}

.likert-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.likert-label {
    display: block;
    padding: 16px 8px;
    text-align: center;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.likert-item:hover .likert-label {
    background: #f8f9fa;
}

.likert-item input[type="radio"]:checked ~ .likert-label {
    background: #e7f3ff;
    color: #0066cc;
    font-weight: 600;
}

.likert-item input[type="radio"]:checked ~ .likert-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #0066cc;
}

/* 제출 버튼 영역 */
.submit-container {
    padding: 24px;
    background: white;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.submit-button {
    display: inline-block;
    padding: 12px 48px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.submit-button:hover {
    background: #0052a3;
}

.submit-button:active {
    transform: scale(0.98);
}

/* 카테고리 섹션 */
.category-section {
    display: none;
    margin-bottom: 32px;
}

.category-section.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 반응형 디자인 */
@media (max-width: 640px) {
    .form-container {
        padding: 24px 16px;
    }
    
    .assessment-container {
        padding: 24px 16px;
    }
    
    .options-container {
        padding: 16px;
    }
    
    .option-label {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .likert-options {
        grid-template-columns: 1fr;
    }
    
    .likert-item {
        border-right: none;
        border-bottom: 1px solid #f1f3f5;
    }
    
    .likert-item:last-child {
        border-bottom: none;
    }
    
    .likert-label {
        padding: 12px;
        text-align: left;
    }
    
    .likert-item input[type="radio"]:checked ~ .likert-label::after {
        width: 3px;
        height: 100%;
        left: 0;
        top: 0;
        bottom: auto;
        right: auto;
    }
    
    .submit-button {
        width: 100%;
        padding: 14px;
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}


/* 스크린 리더 전용 텍스트 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* 키보드 가이드 스타일 */
.keyboard-guide {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.keyboard-guide-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 12px;
}

.keyboard-guide-header svg {
    flex-shrink: 0;
}

.keyboard-guide-content {
    display: grid;
    gap: 8px;
}

.keyboard-guide-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #495057;
}

.key-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #212529;
    box-shadow: 0 2px 0 rgba(0,0,0,0.1);
    font-family: 'Courier New', monospace;
}

.key-description {
    color: #6c757d;
    font-size: 13px;
}

.keyboard-guide-text {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #d4e8ff;
    font-size: 14px;
    color: #495057;
}

.keyboard-guide-text strong {
    color: #0066cc;
    font-weight: 600;
}

/* 현재 선택된 문제 하이라이트 */
.likert-question.current-question {
    border: 2px solid #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    animation: highlightPulse 0.3s ease;
}

@keyframes highlightPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.005);
    }
    100% {
        transform: scale(1);
    }
}

.likert-question.current-question .likert-question-text {
    background: #e7f3ff;
}

.likert-question.current-question .question-badge {
    background: #0052a3;
    animation: badgePulse 0.5s ease;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 모바일에서 키보드 가이드 스타일 조정 */
@media (max-width: 640px) {
    .keyboard-guide {
        padding: 12px;
        font-size: 13px;
    }

    .keyboard-guide-header {
        font-size: 14px;
    }

    .keyboard-guide-item {
        font-size: 12px;
    }

    .key-badge {
        min-width: 24px;
        height: 24px;
        font-size: 11px;
        padding: 0 6px;
    }

    .key-description {
        font-size: 12px;
    }
}