/* ========================================
   ENHANCED STUDENT TEST INTERFACE STYLES
   Modern, professional test-taking UI
   ======================================== */

.imp-test-interface {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
}

/* Enhanced Test Header */
.test-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px 32px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.test-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.test-info {
    position: relative;
    z-index: 1;
}

.test-info h1 {
    margin: 0 0 12px 0;
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.test-type {
    margin: 0;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.badge.pte {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
}

.badge.ielts {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.3) 0%, rgba(245, 87, 108, 0.3) 100%);
}

.badge.oet {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.3) 0%, rgba(0, 242, 254, 0.3) 100%);
}

.badge.celpip {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.3) 0%, rgba(56, 249, 215, 0.3) 100%);
}

.badge.naati_ccl {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.3) 0%, rgba(254, 225, 64, 0.3) 100%);
}

.section-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-left: 12px;
}

/* Enhanced Test Controls */
.test-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Modern Timer Design */
.timer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #2d3748;
}

.timer-icon {
    font-size: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.timer.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #f59e0b;
    animation: warningPulse 1s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 4px 24px rgba(245, 158, 11, 0.5); }
}

.timer.danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: #ef4444;
    animation: dangerPulse 0.5s ease-in-out infinite;
}

@keyframes dangerPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 4px 32px rgba(239, 68, 68, 0.6); }
}

/* Enhanced Buttons */
.save-progress-btn {
    background: white;
    color: #667eea;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.save-progress-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    background: #f8fafc;
}

.submit-test-btn {
    background: white;
    color: #667eea;
    border: 2px solid white;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.submit-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

/* Enhanced Test Content Area */
.test-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Enhanced Question Blocks */
.question-block {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.question-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.question-block:hover {
    border-color: #cbd5e0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Enhanced Question Header */
.question-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.question-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    flex: 1;
}

.question-type-badge {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    color: #5b21b6;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.marks-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* Enhanced Media Elements */
.audio-player {
    margin: 20px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.audio-player audio {
    width: 100%;
    outline: none;
}

.image-display {
    margin: 20px 0;
    text-align: center;
}

.question-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Enhanced Question Text */
.question-text {
    font-size: 16px;
    line-height: 1.8;
    color: #2d3748;
    margin: 20px 0;
}

.question-text p {
    margin-bottom: 16px;
}

/* Timer and Word Count Info */
.question-timer-info,
.word-count-info {
    display: flex;
    gap: 16px;
    margin: 16px 0;
    padding: 12px;
    background: #f0f4ff;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.question-timer-info span,
.word-count-info span {
    font-size: 14px;
    font-weight: 600;
    color: #5b21b6;
}

/* Enhanced MCQ Options */
.mcq-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
}

.mcq-option {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 12px;
}

.mcq-option:hover {
    background: #f0f4ff;
    border-color: #667eea;
    transform: translateX(4px);
}

.mcq-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.mcq-option input[type="radio"]:checked ~ .option-label,
.mcq-option input[type="radio"]:checked ~ .option-text {
    color: #667eea;
    font-weight: 700;
}

.mcq-option:has(input[type="radio"]:checked) {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.option-label {
    font-weight: 700;
    color: #667eea;
    font-size: 16px;
}

.option-text {
    font-size: 15px;
    color: #2d3748;
    line-height: 1.6;
}

/* Enhanced Text Answer Area */
.answer-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.8;
    font-family: inherit;
    resize: vertical;
    min-height: 200px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

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

.answer-textarea::placeholder {
    color: #a0aec0;
}

/* Enhanced Word Counter */
.word-counter {
    margin-top: 12px;
    padding: 8px 16px;
    background: #f0f4ff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #5b21b6;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.word-count {
    color: #667eea;
    font-weight: 700;
    font-size: 16px;
}

/* Enhanced Test Footer */
.test-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.save-exit-btn {
    background: white;
    color: #718096;
    border: 2px solid #e2e8f0;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-exit-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.test-footer .submit-test-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.test-footer .submit-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* No Questions Message */
.no-questions-message {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.no-questions-message p {
    font-size: 16px;
    color: #718096;
    margin: 0;
}

/* Progress Indicator */
.question-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e2e8f0;
    z-index: 1000;
}

.question-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .imp-test-interface {
        padding: 16px;
    }
    
    .test-content {
        padding: 28px;
    }
    
    .question-block {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .test-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .test-info h1 {
        font-size: 22px;
    }
    
    .test-controls {
        width: 100%;
        flex-direction: column;
    }
    
    .timer {
        width: 100%;
        justify-content: center;
    }
    
    .test-content {
        padding: 20px;
    }
    
    .question-block {
        padding: 20px;
    }
    
    .question-header {
        flex-wrap: wrap;
    }
    
    .test-footer {
        flex-direction: column-reverse;
    }
    
    .save-exit-btn,
    .test-footer .submit-test-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .question-header h3 {
        font-size: 18px;
    }
    
    .mcq-option {
        padding: 12px 16px;
    }
    
    .answer-textarea {
        padding: 12px;
        min-height: 150px;
    }
}

/* Print Styles */
@media print {
    .test-header,
    .test-controls,
    .test-footer,
    .save-progress-btn,
    .submit-test-btn,
    .save-exit-btn {
        display: none;
    }
    
    .question-block {
        page-break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* Accessibility */
.answer-textarea:focus,
.mcq-option input[type="radio"]:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-block {
    animation: slideInUp 0.4s ease forwards;
}

.question-block:nth-child(1) { animation-delay: 0.1s; }
.question-block:nth-child(2) { animation-delay: 0.2s; }
.question-block:nth-child(3) { animation-delay: 0.3s; }
.question-block:nth-child(4) { animation-delay: 0.4s; }
.question-block:nth-child(5) { animation-delay: 0.5s; }
