/* Test Layout Styles */

/* Question layout styles */
.question-container {
    margin-bottom: 2rem;
}

.question-title-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .question-title-section {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    box-shadow: 0 4px 15px rgba(74, 85, 104, 0.3);
}

.question-title-section h4 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.4;
    font-weight: 600;
}

/* Main content layout */
.question-content-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    min-height: 300px;
}

/* Answers section (left side) */
.answers-section {
    flex: 1;
    min-width: 0;
}

.answers-section h5 {
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
    font-size: 1.1rem;
}

[data-theme="dark"] .answers-section h5 {
    color: #adb5bd;
}

/* Image section (right side) */
.image-section {
    flex: 0 0 650px;
    position: relative;
}

.image-section.no-image {
    display: none;
}

.test-image {
    width: 100%;
    height: auto;
    max-height: 550px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    transition: transform 0.3s ease;
}

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

[data-theme="dark"] .test-image {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.image-placeholder {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.1rem;
}

[data-theme="dark"] .image-placeholder {
    background: linear-gradient(45deg, #343a40, #495057);
    border-color: #6c757d;
    color: #adb5bd;
}

/* Answer options styling */
.answer-option {
    position: relative;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background-color: #ffffff;
    color: #495057;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.answer-option:disabled,
.answer-option[style*="pointer-events: none"] {
    cursor: not-allowed;
    opacity: 0.8;
}

.answer-option:hover {
    border-color: #007bff;
    background-color: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.answer-option.selected {
    border-color: #007bff;
    background-color: #e7f3ff;
    color: #0056b3;
}

.answer-option.correct {
    border-color: #28a745 !important;
    background-color: #d4edda !important;
    color: #155724 !important;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
}

.answer-option.incorrect {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
    color: #721c24 !important;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.3);
}


.answer-option.correct .answer-key {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
    color: white !important;
}

.answer-option.incorrect .answer-key {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
}

/* Dark theme answer options */
[data-theme="dark"] .answer-option {
    background-color: #343a40;
    border-color: #495057;
    color: #ffffff;
}

[data-theme="dark"] .answer-option:hover {
    border-color: #007bff;
    background-color: #404448;
}

[data-theme="dark"] .answer-option.selected {
    border-color: #007bff;
    background-color: #1a2332;
    color: #66b3ff;
}

[data-theme="dark"] .answer-option.correct {
    border-color: #28a745 !important;
    background-color: #1e3a25 !important;
    color: #75d487 !important;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
}

[data-theme="dark"] .answer-option.incorrect {
    border-color: #dc3545 !important;
    background-color: #3a1e21 !important;
    color: #f5a6a6 !important;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.3);
}

/* Answer key styling */
.answer-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    height: 2.2rem;
    padding: 0 0.75rem;
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.answer-option:hover .answer-key {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.answer-option.selected .answer-key {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-color: #007bff;
    transform: scale(1.05);
}

.answer-option.correct .answer-key {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
    border-color: #28a745 !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.4);
}

.answer-option.incorrect .answer-key {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    border-color: #dc3545 !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.4);
}

.answer-text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.4;
}

/* Progress indicators */
.progress-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    z-index: 1;
}

/* Navigation buttons */
.navigation-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
}

[data-theme="dark"] .navigation-wrapper {
    border-top-color: #495057;
}

.btn-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive design */
@media (max-width: 992px) {
    .question-content-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .image-section {
        flex: none;
        order: -1;
    }
    
    .image-section.no-image {
        display: none;
    }
    
    .question-title-section {
        padding: 1.25rem;
    }
    
    .question-title-section h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .question-content-wrapper {
        gap: 1rem;
    }
    
    .answer-option {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }
    
    .answer-key {
        min-width: 2.5rem;
        height: 2rem;
        font-size: 0.8rem;
        padding: 0 0.5rem;
    }
    
    .answer-text {
        font-size: 0.95rem;
    }
    
    .navigation-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .navigation-wrapper .btn-nav {
        width: 100%;
        justify-content: center;
    }
    
    .question-title-section {
        padding: 1rem;
    }
    
    .question-title-section h4 {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .test-container {
        margin: 0 0.5rem;
    }
    
    .answer-option {
        padding: 0.75rem;
        gap: 0.5rem;
        font-size: 0.9rem;
    }
    
    .answer-key {
        min-width: 2rem;
        height: 1.8rem;
        font-size: 0.75rem;
        padding: 0 0.4rem;
    }
    
    .question-title-section {
        padding: 0.875rem;
        margin-bottom: 1rem;
    }
}

/* Animation for answer feedback */
@keyframes correctAnswer {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 rgba(40, 167, 69, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(40, 167, 69, 0.6);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
    }
}

@keyframes incorrectAnswer {
    0% { 
        transform: translateX(0);
        box-shadow: 0 0 0 rgba(220, 53, 69, 0.3);
    }
    25% { 
        transform: translateX(-5px);
        box-shadow: 0 0 25px rgba(220, 53, 69, 0.6);
    }
    75% { 
        transform: translateX(5px);
        box-shadow: 0 0 25px rgba(220, 53, 69, 0.6);
    }
    100% { 
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(220, 53, 69, 0.3);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.answer-option.correct {
    animation: correctAnswer 0.8s ease;
}

.answer-option.incorrect {
    animation: incorrectAnswer 0.8s ease;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(52, 58, 64, 0.8);
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}