/* Exam Module Skin CSS - Business Style */

/* Reset & Base */
.exam-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.text-success { color: #38ef7d; }
.text-warning { color: #f5576c; }
.text-danger { color: #eb3349; }
.pull-right { float: right; }
.mb-2 { margin-bottom: 10px; }
.mt-3 { margin-top: 20px; }

/* Page Header */
.exam-page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.exam-page-header h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #fff;
}

.exam-page-header p {
    opacity: 0.9;
    margin: 0;
    font-size: 14px;
}

/* Filter Tabs */
.exam-filter-tabs {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    gap: 6px;
}

.exam-filter-tab {
    flex: 1;
    padding: 14px 24px;
    color: #6c757d;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.exam-filter-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    text-decoration: none;
}

.exam-filter-tab.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Labels / Badges */
.label {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.label-default { background: #e9ecef; color: #6c757d; }
.label-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.label-success { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); color: white; }
.label-info { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; }
.label-warning { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; }
.label-danger { background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%); color: white; }
.label-lg { font-size: 18px; padding: 12px 30px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}
.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-default {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}
.btn-default:hover {
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: #fff;
}
.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.3);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
    text-decoration: none;
    color: #fff;
}
.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}
.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
    text-decoration: none;
    color: #fff;
}
.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}
.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
    text-decoration: none;
    color: #fff;
}
.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(235, 51, 73, 0.3);
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(235, 51, 73, 0.4);
    text-decoration: none;
    color: #fff;
}
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Forms */
.form-control {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: white;
}
.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Cards */
.exam-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
}

.exam-card-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.exam-card-body {
    padding: 24px;
}

/* Exam Info Grid */
.exam-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.exam-info-item {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
}

.exam-info-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.exam-info-value {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Grade Type Badge */
.exam-grade-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.exam-grade-badge.auto {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
}

.exam-grade-badge.manual {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

/* Status Alert */
.exam-status-alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.exam-status-alert.completed {
    background: rgba(79, 172, 254, 0.1);
    border-left: 4px solid #4facfe;
}

.exam-status-alert.waiting {
    background: rgba(240, 173, 78, 0.1);
    border-left: 4px solid #f0ad4e;
}

.exam-status-alert.in-progress {
    background: rgba(241, 39, 17, 0.1);
    border-left: 4px solid #f5af19;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% { border-left-color: #f5af19; }
    50% { border-left-color: #f12711; }
}

/* Button Area */
.exam-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    margin-top: 20px;
}

/* Results Table */
.exam-results-table {
    width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.exam-results-table table {
    width: 100%;
    border-collapse: collapse;
}

.exam-results-table thead {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.exam-results-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exam-results-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f5;
    color: #495057;
}

.exam-results-table tbody tr {
    transition: all 0.3s ease;
}

.exam-results-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.03);
}

.exam-results-table tbody tr:last-child td {
    border-bottom: none;
}

/* Empty State */
.exam-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.exam-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.exam-empty-text {
    font-size: 18px;
    color: #6c757d;
    font-weight: 500;
}

/* Pagination */
.exam-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 30px;
    padding: 20px 0;
}

.exam-pagination a,
.exam-pagination strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    color: #495057;
    background: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.exam-pagination a:hover {
    background: #e4e6ea;
    border-color: #adb5bd;
    color: #212529;
}

.exam-pagination strong {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

/* ========================================
   Exam Take Page
   ======================================== */
.exam-take-page .exam-header {
    margin-bottom: 30px;
}

.exam-take-page .exam-timer {
    position: fixed;
    top: 100px;
    right: 30px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.15);
    z-index: 100;
}

.exam-take-page .exam-timer-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.exam-take-page #timer {
    font-size: 28px;
    font-weight: 700;
    color: #eb3349;
}

.question-item {
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    overflow: hidden;
}

.question-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-number {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
}

.question-score {
    color: #6c757d;
    font-size: 14px;
}

.question-body {
    padding: 24px;
}

.question-text {
    font-size: 16px;
    line-height: 1.8;
    color: #2c3e50;
    margin-bottom: 24px;
}

.options-group .radio {
    margin: 10px 0;
    padding: 16px 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
}

.options-group .radio:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.03);
}

.options-group .radio.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.options-group label {
    font-weight: normal;
    cursor: pointer;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-number {
    font-weight: 600;
    color: #667eea;
    min-width: 24px;
}

.short-answer input,
.essay-answer textarea {
    width: 100%;
}

.essay-answer textarea {
    min-height: 200px;
    resize: vertical;
}

.submit-area {
    margin-top: 40px;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
}

/* ========================================
   Exam Result Page
   ======================================== */
.exam-result-page .result-header {
    text-align: center;
    padding: 50px 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.exam-result-page .result-header.passed {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.exam-result-page .result-header.failed {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.score-display {
    font-size: 72px;
    margin: 20px 0;
}

.score {
    font-weight: 700;
}

.score-unit {
    font-size: 32px;
    opacity: 0.8;
}

.pass-status {
    margin: 24px 0;
}

.passing-info {
    opacity: 0.9;
    margin-top: 16px;
    font-size: 16px;
}

.result-info {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.question-review {
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.question-review .panel-heading {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    padding: 16px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-review .panel-body {
    padding: 24px;
}

.options-review .option-item {
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.options-review .option-item.correct {
    background: rgba(56, 239, 125, 0.15);
    border-left: 4px solid #38ef7d;
}

.options-review .option-item.selected {
    border: 2px solid #667eea;
}

.answer-display {
    margin-top: 20px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.btn-area {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Waiting Grade Page */
.waiting-grade-page {
    text-align: center;
    padding: 80px 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.waiting-grade-page .waiting-icon {
    font-size: 80px;
    margin-bottom: 24px;
}

.waiting-grade-page h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 16px;
}

.waiting-grade-page p {
    color: #6c757d;
    margin-bottom: 12px;
    font-size: 15px;
}

/* Panels (Legacy support) */
.panel {
    border: none;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.panel-heading {
    padding: 16px 24px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-bottom: 1px solid #e9ecef;
}

.panel-body {
    padding: 24px;
    background: white;
}

.panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.panel-success .panel-heading {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-color: transparent;
}

.panel-success .panel-title {
    color: white;
}

.panel-danger .panel-heading {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    border-color: transparent;
}

.panel-danger .panel-title {
    color: white;
}

.panel-warning .panel-heading {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: transparent;
}

.panel-warning .panel-title {
    color: white;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: none;
}

.alert-info {
    background: rgba(79, 172, 254, 0.1);
    border-left: 4px solid #4facfe;
    color: #2c3e50;
}

.alert-success {
    background: rgba(56, 239, 125, 0.1);
    border-left: 4px solid #38ef7d;
    color: #2c3e50;
}

.alert-warning {
    background: rgba(240, 173, 78, 0.1);
    border-left: 4px solid #f0ad4e;
    color: #2c3e50;
}

.alert-danger {
    background: rgba(235, 51, 73, 0.1);
    border-left: 4px solid #eb3349;
    color: #2c3e50;
}

/* Ticket Status */
.ticket-available {
    color: #38ef7d;
    font-weight: 600;
}

.ticket-none {
    color: #eb3349;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .exam-page {
        padding: 16px;
    }

    .exam-page-header {
        padding: 24px;
        border-radius: 12px;
    }

    .exam-page-header h2 {
        font-size: 22px;
    }

    .exam-filter-tabs {
        flex-direction: column;
    }

    .exam-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .exam-actions {
        flex-direction: column;
    }

    .exam-actions .btn {
        width: 100%;
    }

    .exam-take-page .exam-timer {
        position: static;
        margin-bottom: 20px;
    }

    .score-display {
        font-size: 48px;
    }

    .btn-area {
        flex-direction: column;
    }

    .btn-area .btn {
        width: 100%;
    }
}

/* ========================================
   Retake Exam Styles
   ======================================== */
.retake-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: none;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.retake-notice h4 {
    margin: 0 0 12px 0;
    color: #856404;
    font-size: 18px;
    font-weight: 600;
}

.retake-notice p {
    margin: 0 0 8px 0;
    color: #856404;
}

.retake-notice p:last-child {
    margin-bottom: 0;
}

.btn-warning {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    border: none;
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f12711 0%, #f5af19 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(241, 39, 17, 0.3);
}

/* ========================================
   Wrong Answer Review (불합격 시 틀린 문제)
   ======================================== */
.wrong-answer-review {
    margin-top: 20px;
}

.wrong-answer-review .question-review.panel-danger .panel-heading {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.wrong-answer-review .question-review.panel-danger .panel-title,
.wrong-answer-review .question-review.panel-danger .question-number,
.wrong-answer-review .question-review.panel-danger .question-type {
    color: white;
}

.wrong-answer-review .options-review .option-item.selected {
    background: rgba(235, 51, 73, 0.15);
    border: 2px solid #eb3349;
    border-left: 4px solid #eb3349;
}

.wrong-answer-review .options-review .option-item {
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.wrong-answer-review .essay-answer-box {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-top: 10px;
    white-space: pre-wrap;
    line-height: 1.8;
}

.feedback-display {
    margin-top: 16px;
}

.feedback-display strong {
    display: block;
    margin-bottom: 8px;
    color: #4facfe;
}

.feedback-display p {
    margin: 0;
    line-height: 1.7;
}
