/* 전체 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.8;
}

/* 시험 페이지 전용 스타일 */
body.exam-page {
    background: #f5f7fa;
}

body.exam-page .container {
    max-width: 100%;
    padding: 10px;
    align-items: flex-start;
}

/* 시험 전용 컨테이너 - 전체 화면 활용 */
.exam-full-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 10px;
    background: transparent;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 제출 페이지 스타일 */
.submission-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 700px;
    backdrop-filter: blur(10px);
}

/* 로그인 페이지 스타일 (호환성을 위해 유지) */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.submission-container h1, .login-container h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #667eea;
    font-size: 24px;
}

.submission-container h2, .login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-size: 18px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #5a6fd8;
}

.admin-link, .student-link {
    text-align: center;
    margin-top: 20px;
}

.admin-link a, .student-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.admin-link a:hover, .student-link a:hover {
    text-decoration: underline;
}

/* 파일 업로드 관련 스타일 */
.file-info {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.drag-drop-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8f9fa;
}

.drag-drop-area:hover {
    border-color: #667eea;
    background: #f0f3ff;
}

.drag-drop-area.dragover {
    border-color: #667eea;
    background: #e8f0ff;
    transform: scale(1.02);
}

.drag-drop-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.drag-drop-area p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.file-name {
    display: block;
    margin-top: 10px;
    color: #667eea;
    font-weight: 500;
    font-size: 14px;
}

.submission-form input[type="file"] {
    display: none;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 20px;
}

.submit-btn:hover {
    background: #218838;
}

.submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 시험 페이지 스타일 */
.exam-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.exam-header h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.exam-info {
    display: flex;
    justify-content: space-between;
    color: #666;
}

.exam-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    min-height: 500px;
}

.question-navigation {
    background: #f8f9fa;
    padding: 20px;
    width: 200px;
    border-right: 1px solid #ddd;
}

.question-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

#questionNumbers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.question-number {
    padding: 10px;
    text-align: center;
    background: #e9ecef;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.question-number:hover {
    background: #667eea;
    color: white;
}

.question-number.active {
    background: #667eea;
    color: white;
}

.question-number.answered {
    background: #28a745;
    color: white;
}

#currentQuestion {
    flex: 1;
}

#questionTitle {
    color: #667eea;
    margin-bottom: 20px;
}

#questionText {
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 16px;
}

#answerOptions {
    margin-bottom: 30px;
}

.answer-option {
    margin-bottom: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.answer-option:hover {
    background: #e9ecef;
}

.answer-option.selected {
    background: #667eea;
    color: white;
}

.question-controls {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: auto;
}

.nav-btn, .submit-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.nav-btn {
    background: #6c757d;
    color: white;
}

.nav-btn:hover {
    background: #5a6268;
}

.submit-btn {
    background: #dc3545;
    color: white;
}

.submit-btn:hover {
    background: #c82333;
}

/* 관리자 페이지 스타일 */
.admin-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 900px;
}

.admin-login {
    max-width: 400px;
    margin: 0 auto;
}

.admin-panel {
    width: 100%;
}

.admin-nav {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
}

.nav-tab {
    padding: 15px 25px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.logout-btn {
    margin-left: auto;
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 테이블 스타일 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

/* 관리자 페이지 추가 스타일 */
.submissions-controls, .exam-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.reset-btn {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.reset-btn:hover {
    background: #c82333;
}

.detail-btn {
    background: #17a2b8;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.detail-btn:hover {
    background: #138496;
}

.refresh-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.refresh-btn:hover {
    background: #5a6fd8;
}

.total-count {
    font-weight: 600;
    color: #667eea;
}

.download-btn {
    padding: 5px 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    background: #218838;
}

.no-file {
    color: #999;
    font-style: italic;
}

/* 통계 카드 스타일 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-left: 4px solid #667eea;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    display: block;
}

.recent-submissions {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recent-submissions h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.recent-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.recent-info {
    flex: 1;
}

.recent-name {
    font-weight: 600;
    color: #333;
}

.recent-email {
    font-size: 12px;
    color: #666;
}

.recent-time {
    font-size: 12px;
    color: #999;
}

/* 결과 페이지 스타일 */
.results-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
}

.result-summary {
    text-align: center;
    margin-bottom: 40px;
}

.score-display h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 36px;
}

.score-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 1s ease-in-out;
}

.result-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.result-info p {
    margin-bottom: 10px;
    font-size: 16px;
}

.detailed-results {
    margin-bottom: 30px;
}

.question-result {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid #ddd;
}

.question-result.correct {
    background: #d4edda;
    border-left-color: #28a745;
}

.question-result.incorrect {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.print-btn, .home-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.print-btn {
    background: #667eea;
    color: white;
}

.print-btn:hover {
    background: #5a6fd8;
}

.home-btn {
    background: #6c757d;
    color: white;
}

.home-btn:hover {
    background: #5a6268;
}

/* 메시지 스타일 */
.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 시험 메뉴 스타일 */
.exam-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.menu-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.menu-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.menu-item h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 28px;
    font-weight: 700;
}

.menu-item p {
    color: #6c757d;
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.5;
}

.exam-btn, .submit-form-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.exam-btn:hover, .submit-form-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.submit-form-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

/* 시험 시작 폼 스타일 */
.exam-start-form {
    margin-top: 20px;
}

.exam-start-form .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.exam-start-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.exam-start-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.exam-start-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.exam-start-form input::placeholder {
    color: #999;
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #5a6268;
}

.submission-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 반응형 메뉴 */
@media (max-width: 768px) {
    .submission-container {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .exam-menu {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .menu-item {
        padding: 30px 20px;
    }
    
    .menu-item h2 {
        font-size: 24px;
    }
    
    .exam-btn, .submit-form-btn {
        padding: 15px 30px;
        font-size: 16px;
    }
}

/* 시험 시스템 전용 스타일 */

/* 시험 헤더 */
.exam-header {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-header h1 {
    color: #667eea;
    font-size: 24px;
    margin: 0;
}

.exam-info {
    display: flex;
    gap: 30px;
    font-weight: 500;
}

.exam-info span {
    color: #555;
}

#timer {
    color: #e74c3c;
    font-weight: bold;
    font-size: 18px;
}

/* 시험 컨테이너 - 400px 네비게이션 */
.exam-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 25px;
    height: calc(100vh - 180px);
    max-width: 100%;
    width: 100%;
}

/* 문제 네비게이션 - 충분한 공간 확보 */
.question-navigation {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.question-navigation h4 {
    margin-bottom: 15px;
    color: #667eea;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* 네비게이션 컨테이너 */
.question-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 문제 섹션별 네비게이션 - 충분한 공간 */
.question-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
    min-height: 0;
}

.question-section h5 {
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
    border-left: 4px solid #667eea;
    flex-shrink: 0;
}

.section-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    flex: 1;
    align-content: start;
    min-height: 0;
    padding: 5px;
}

/* A형 섹션 (8개 버튼) - 4열 그리드 */
.section-nav-4 {
    grid-template-columns: repeat(4, 1fr);
}

.nav-btn {
    width: 100%;
    aspect-ratio: 1;
    max-width: 55px;
    max-height: 55px;
    border: 2px solid #ddd;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    min-height: 35px;
    box-sizing: border-box;
}

.nav-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.nav-btn.current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.nav-btn.answered {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.nav-btn.answered.current {
    background: #155724;
    border-color: #155724;
}

/* 문제 내용 영역 - 더 넓고 편안한 공간 */
.question-content {
    background: white;
    padding: 35px 45px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    width: 100%;
    max-width: none;
}

.question-header h3 {
    color: #667eea;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.question-text {
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 16px;
}

.answer-options {
    margin-bottom: 30px;
}

.option-label {
    display: block;
    margin: 12px 0;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.option-label input[type="radio"] {
    margin-right: 10px;
}

.option-label input[type="radio"]:checked + * {
    font-weight: 600;
}

.answer-input textarea {
    width: 100%;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 150px;
    max-width: none;
}

.answer-input textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 스키마 정보 - 더 넓은 공간 */
.schema-info, .sample-data {
    background: #f8f9fa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    width: 100%;
}

.schema-info h4, .sample-data h4 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.schema-info pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
    line-height: 1.4;
}

/* 문제 컨트롤 - 정렬된 버튼 영역 */
.question-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: white;
    padding: 18px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 320px;
}

.question-controls .nav-btn {
    flex: 1;
    height: 45px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn {
    background: #e74c3c;
    color: white;
    border: none;
    height: 45px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn:hover {
    background: #c0392b;
}

.question-controls .submit-btn {
    flex: 1;
}

/* 결과 페이지 스타일 */
.results-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    max-width: 1000px;
    width: 100%;
}

.results-container h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 28px;
}

.result-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.score-display h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 24px;
}

.score-bar {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.score-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.score-fill.excellent { background: #27ae60; }
.score-fill.good { background: #3498db; }
.score-fill.average { background: #f39c12; }
.score-fill.poor { background: #e74c3c; }

.score-percentage {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.result-info p {
    margin: 8px 0;
    font-size: 16px;
}

/* 카테고리별 점수 */
.category-results {
    margin-bottom: 40px;
}

.category-results h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 20px;
}

.category-score {
    display: grid;
    grid-template-columns: 1fr 3fr 80px;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.category-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-name {
    font-weight: 600;
    color: #2c3e50;
}

.category-points {
    color: #7f8c8d;
    font-size: 14px;
}

.category-bar {
    height: 12px;
    background: #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
}

.category-fill {
    height: 100%;
    background: #667eea;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.category-percentage {
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
}

/* 상세 결과 */
.detailed-results h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 20px;
}

.question-result {
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.question-result.correct {
    border-color: #27ae60;
}

.question-result.incorrect {
    border-color: #e74c3c;
}

.question-result .question-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-result.correct .question-header {
    background: #d4edda;
}

.question-result.incorrect .question-header {
    background: #f8d7da;
}

.question-result h4 {
    color: #2c3e50;
    margin: 0;
}

.result-icon {
    font-size: 20px;
    font-weight: bold;
}

.question-result.correct .result-icon {
    color: #27ae60;
}

.question-result.incorrect .result-icon {
    color: #e74c3c;
}

.question-result .question-content {
    padding: 20px;
}

.question-result .question-content p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.no-answer {
    color: #e74c3c;
    font-style: italic;
}

.feedback {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid;
}

.feedback.success {
    background: #d4edda;
    border-color: #27ae60;
    color: #155724;
}

.feedback.warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.feedback.error {
    background: #f8d7da;
    border-color: #e74c3c;
    color: #721c24;
}

/* 통계 */
.stat-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.stat-label {
    color: #7f8c8d;
}

.stat-value {
    font-weight: 600;
    color: #2c3e50;
}

.grade-a { color: #27ae60; }
.grade-b { color: #3498db; }
.grade-c { color: #f39c12; }
.grade-d { color: #e67e22; }
.grade-f { color: #e74c3c; }

/* 액션 버튼 */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.result-actions button {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.print-btn {
    background: #34495e;
    color: white;
}

.print-btn:hover {
    background: #2c3e50;
}

.retry-btn {
    background: #3498db;
    color: white;
}

.retry-btn:hover {
    background: #2980b9;
}

.home-btn {
    background: #667eea;
    color: white;
}

.home-btn:hover {
    background: #5a67d8;
}

/* 노트북 최적화 - 1280px+ 기준 */
@media (max-width: 1280px) {
    .exam-container {
        grid-template-columns: 380px 1fr;
        gap: 20px;
    }
    
    .question-content {
        padding: 30px 35px;
    }
    
    .nav-btn {
        max-width: 60px;
        max-height: 60px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .exam-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 15px;
        height: auto;
    }
    
    .question-navigation {
        order: 2;
        margin-top: 15px;
        height: 300px;
        padding: 12px;
    }
    
    .question-section {
        margin-bottom: 8px;
    }
    
    .question-section h5 {
        font-size: 10px;
        padding: 4px 8px;
        margin-bottom: 6px;
    }
    
    .section-nav {
        grid-template-columns: repeat(5, 1fr);
        gap: 3px;
    }
    
    .section-nav-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .nav-btn {
        max-width: 50px;
        max-height: 50px;
        min-height: 32px;
        font-size: 10px;
        border-radius: 4px;
    }
    
    .question-content {
        padding: 20px;
        order: 1;
    }
    
    .answer-input textarea {
        min-height: 120px;
        padding: 15px;
    }
    
    .question-controls {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 20px;
        justify-content: center;
        order: 3;
        min-width: auto;
        padding: 15px 20px;
    }
    
    .question-controls .nav-btn {
        min-width: 70px;
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .submit-btn {
        min-width: 90px;
        padding: 10px 25px;
        font-size: 13px;
    }
}
    
    .result-summary {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-score {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .result-actions button {
        width: 200px;
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .exam-container {
        flex-direction: column;
    }
    
    .question-navigation {
        width: 100%;
        padding: 15px;
    }
    
    #questionNumbers {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .admin-nav {
        flex-wrap: wrap;
    }
    
    .nav-tab {
        flex: 1;
        min-width: 120px;
    }
}