/* IBT TOPIK Exam Styles */

/* Exam Container */
.exam-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Question Card */
.question-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.question-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.15);
}

/* Question Content */
.question-content {
    margin-bottom: 2rem;
    padding: 0;
    background: transparent;
    transition: all 0.3s ease;
}

.question-content h5 {
    color: #212529;
    font-weight: 600;
    margin-bottom: 1rem;
}

.question-content .mb-3.font-weight-bold {
    color: #495057;
    font-size: 1.1rem;
}

.question-content .question-text {
    color: #212529;
}


.question-content .option-item:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.question-content .option-item input[type="radio"]:checked + label {
    color: #212529;
    font-weight: normal;
}

.question-content .option-item input[type="radio"]:checked ~ .option-number {
    background-color: #495057;
    color: white;
    border-color: #495057;
}

.question-content .option-number {
    color: #495057;
    border-color: #495057;
}

.question-content .btn-primary {
    background-color: #495057;
    border-color: #495057;
}

.question-content .btn-primary:hover {
    background-color: #343a40;
    border-color: #343a40;
}

.question-content .btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.question-content .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Progress Bar */
.exam-progress {
    background: #e9ecef;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.exam-progress-bar {
    height: 100%;
    background: #495057;
    transition: width 0.6s ease;
    border-radius: 4px;
}

.progress-text {
    font-weight: 600;
    color: #495057;
}

/* Question Options */
.option-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item:hover {
    transform: none;
}

.option-item.selected {
    border-color: #dee2e6;
    background-color: white;
    box-shadow: none;
    transform: none;
    position: relative;
}

.option-item.selected::after {
    content: '';
    display: none;
}

.option-item input[type="radio"] {
    display: none;
}

.option-item label {
    cursor: pointer;
    margin: 0;
    width: 100%;
    transition: all 0.3s ease;
    color: #212529;
}

.option-item input[type="radio"]:checked + label {
    color: #212529;
    font-weight: normal;
}

.option-item input[type="radio"]:checked ~ .option-number {
    background-color: #495057;
    color: white;
    border-color: #495057;
    transform: none;
    box-shadow: none;
}

/* 새로운 번호 스타일 */
.option-number {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 15px;
    text-align: center;
    background-color: transparent;
    color: #495057;
    border: 1px solid #495057;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

/* 문제 선택지 선택 시 번호 스타일 */
.option-item input[type="radio"]:checked + label .option-number {
    background-color: #495057;
    color: white;
    border-color: #495057;
}

/* Section Options */
.section-option {
    border: 2px solid #dee2e6;
    background-color: #f8f9fa;
    opacity: 0.8;
    cursor: not-allowed;
}

.section-option:hover {
    border-color: #dee2e6;
    background-color: #f8f9fa;
    transform: none;
}

.section-option input[type="radio"]:disabled + label {
    color: #6c757d;
    cursor: not-allowed;
}

.option-item:hover {
    border-color: #e9ecef;
    background-color: white;
    transform: none;
}

.option-item.selected {
    border-color: #e9ecef;
    background-color: white;
    box-shadow: none;
    transform: none;
    position: relative;
}

.option-item.selected::after {
    content: '';
    display: none;
}

.option-item input[type="radio"] {
    display: none;
}

.option-item label {
    cursor: pointer;
    margin: 0;
    width: 100%;
    transition: all 0.3s ease;
}

.option-item input[type="radio"]:checked + label {
    color: #495057;
    font-weight: normal;
}

.option-item input[type="radio"]:checked ~ .option-number {
    background-color: #495057;
    color: white;
    border-color: #495057;
    transform: none;
    box-shadow: none;
}

/* 새로운 번호 스타일 */
.option-number {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 15px;
    text-align: center;
    background-color: transparent;
    color: #495057;
    border: 1px solid #495057;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

/* 섹션 선택지 번호 스타일 */
.section-option-number {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 15px;
    text-align: center;
    background-color: transparent;
    color: #495057;
    border: 2px solid #495057;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* 섹션 정답 선택지 번호 스타일 */
.section-correct-option-number {
    background-color: #495057 !important;
    color: white !important;
    border-color: #495057 !important;
}

/* Question Images */
.question-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.question-image:hover {
    transform: scale(1.02);
}

/* Section Information */
.section-info-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.section-info-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.section-info-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.section-info-item:hover {
    background-color: rgba(73, 80, 87, 0.05);
}

.section-info-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
    background: #495057;
    color: white;
}

.section-info-text {
    flex: 1;
}

.section-info-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.section-info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.section-alert {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 0.75rem;
    color: #0d47a1;
    padding: 1rem;
    margin-top: 1rem;
}

.section-alert i {
    color: #1976d2;
}

.section-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    transition: transform 0.3s ease;
}

.section-image:hover {
    transform: scale(1.02);
}

/* Listening Question Styles */
.listening-controls {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.listening-alert {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: 0.75rem;
    color: #856404;
    padding: 1rem;
    margin-bottom: 1rem;
}

.listening-alert i {
    color: #f39c12;
}

.show-options-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
}

.show-options-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
    color: white;
}

.show-options-btn:disabled {
    background: #28a745;
    transform: none;
    box-shadow: none;
    opacity: 0.8;
    cursor: not-allowed;
}

.options-container {
    transition: all 0.5s ease;
}

.options-container.hidden {
    display: none;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #212529;
    font-weight: 500;
}

.option-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

/* Audio Player */
.audio-player {
    width: 100%;
    margin: 1rem 0;
    border-radius: 0.5rem;
    background: #f8f9fa;
    padding: 1rem;
}

.audio-player audio {
    width: 100%;
    border-radius: 0.5rem;
}

/* Submit Button */
.submit-btn {
    background: #495057;
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
    color: white;
    background: #343a40;
}

.submit-btn:disabled {
    background: #6c757d;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Exit Button */
.exit-btn {
    background: transparent;
    border: 2px solid #dc3545;
    color: #dc3545;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.exit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 53, 69, 0.1), transparent);
    transition: left 0.5s;
}

.exit-btn:hover::before {
    left: 100%;
}

.exit-btn:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
}

/* Result Page */
.result-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.result-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.score-display {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
}

.grade-display {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

.grade-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Intro Page */
.intro-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.intro-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list i {
    width: 20px;
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* Form Enhancements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Alert Enhancements */
.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: none;
    border-radius: 0.75rem;
    color: #0d47a1;
}

.alert-info h6 {
    color: #0d47a1;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .question-card {
        margin: 0.5rem;
        border-radius: 0.5rem;
    }
    
    .question-content {
        margin-bottom: 1rem;
    }
    
    .question-content .option-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .option-item {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .option-number {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 0.875rem;
    }
    
    .submit-btn,
    .exit-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .score-display {
        font-size: 2rem;
    }
    
    .grade-display {
        font-size: 1.75rem;
    }
    
    .grade-icon {
        font-size: 3rem;
    }
    
    /* Section Info Responsive */
    .section-info-item {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .section-info-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin-right: 0.75rem;
    }
    
    .section-info-label {
        font-size: 0.8rem;
    }
    
    .section-info-value {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .option-item {
        padding: 0.5rem;
    }
    
    .option-number {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 0.75rem;
        margin-right: 0.5rem;
    }
    
    .submit-btn,
    .exit-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    /* Section Info Mobile */
    .section-info-item {
        padding: 0.25rem;
        margin-bottom: 0.25rem;
    }
    
    .section-info-icon {
        width: 30px;
        height: 30px;
        font-size: 0.875rem;
        margin-right: 0.5rem;
    }
    
    .section-info-label {
        font-size: 0.75rem;
    }
    
    .section-info-value {
        font-size: 0.8rem;
    }
    
    .section-alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Listening Controls Mobile */
    .listening-controls {
        padding: 1rem;
    }
    
    .listening-alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .show-options-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Touch Device Support */
.touch-active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Modal Enhancements */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Image Modal */
#imageModal .modal-body {
    padding: 0;
}

#imageModal .modal-body img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Print Styles */
@media print {
    .submit-btn,
    .exit-btn,
    .btn {
        display: none !important;
    }
    
    .question-card,
    .result-card,
    .intro-card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .exam-progress {
        display: none !important;
    }
}

/* 멀티 선택 방지 - 선택된 옵션의 번호 스타일만 변경 */
.option-item input[type="radio"]:checked ~ .option-number {
    background-color: #495057 !important;
    color: white !important;
    border-color: #495057 !important;
}

/* Timer Styles */
.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.timer-display {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #212529;
    transition: all 0.3s ease;
}

.timer-display i {
    font-size: 1.1rem;
}

.timer-label {
    font-size: 0.75rem;
    text-align: center;
    margin-top: 0.25rem;
}

/* Timer color states */
.timer-display.text-warning {
    color: #ffc107 !important;
}

.timer-display.text-danger {
    color: #dc3545 !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Fixed Progress Bar */
.fixed-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: white;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0;
    width: 100%;
}

/* 컨테이너 상단 여백 추가 (고정된 진행률 바 높이만큼) */
.container-fluid {
    padding-top: 80px; /* 진행률 바 높이 + 여백 */
}

/* 반응형 고정 진행률 바 */
@media (max-width: 768px) {
    .fixed-progress-bar {
        padding: 0.5rem;
    }
    
    .fixed-progress-bar .card-body {
        padding: 0.75rem;
    }
    
    .container-fluid {
        padding-top: 70px;
    }
}

@media (max-width: 576px) {
    .fixed-progress-bar {
        padding: 0.25rem;
    }
    
    .fixed-progress-bar .card-body {
        padding: 0.5rem;
    }
    
    .container-fluid {
        padding-top: 60px;
    }
}

/* Responsive timer */
@media (max-width: 768px) {
    .timer-container {
        min-width: 100px;
    }
    
    .timer-display {
        font-size: 1rem;
    }
    
    .timer-display i {
        font-size: 1rem;
    }
    
    .timer-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .timer-container {
        min-width: 80px;
    }
    
    .timer-display {
        font-size: 0.9rem;
    }
    
    .timer-display i {
        font-size: 0.9rem;
    }
    
    .timer-label {
        font-size: 0.65rem;
    }
}

/* 선택된 옵션의 강화된 스타일 */
.option-item.selected {
    background-color: #f8f9fa !important;
    border-color: #495057 !important;
    border-width: 2px !important;
    box-shadow: 0 2px 8px rgba(73, 80, 87, 0.2) !important;
    transform: scale(1.02) !important;
    transition: all 0.2s ease !important;
}

.option-item.selected .option-number {
    background-color: #495057 !important;
    color: white !important;
    border-color: #495057 !important;
    transform: scale(1.1) !important;
    transition: all 0.2s ease !important;
}

/* 선택되지 않은 옵션의 스타일 초기화 */
.option-item:not(.selected) .option-number {
    background-color: transparent !important;
    color: #495057 !important;
    border-color: #495057 !important;
    transform: scale(1) !important;
    transition: all 0.2s ease !important;
}

/* 라벨 클릭 시 호버 효과 */
.option-item label:hover {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
} 