/* NexGen Test - Frontend Styles */

/* Container */
.nexgen-exam-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Screens */
.exam-screen {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Start Screen */
.start-screen-header {
    text-align: center;
    margin-bottom: 40px;
}

.exam-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.exam-title {
    font-size: 36px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 15px 0;
}

.exam-subtitle {
    font-size: 18px;
    color: #6b7280;
}

/* Info Grid */
.exam-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.info-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.info-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.info-value {
    font-size: 24px;
    font-weight: bold;
}

/* Instructions */
.exam-instructions {
    background: #f9fafb;
    border-left: 4px solid #3b82f6;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.exam-instructions h3 {
    margin-top: 0;
    color: #1f2937;
}

.exam-instructions ul {
    margin: 15px 0;
    padding-left: 25px;
}

.exam-instructions li {
    margin: 10px 0;
    color: #4b5563;
    line-height: 1.6;
}

/* Start Button */
#start-exam-btn {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    padding: 18px 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

#start-exam-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.5);
}

/* Timer */
.exam-timer {
    position: sticky;
    top: 20px;
    z-index: 100;
    text-align: center;
    margin-bottom: 30px;
}

.timer-display {
    display: inline-block;
    background: #1f2937;
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.timer-display.timer-warning {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Question Card */
.exam-question {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.exam-question:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.question-number {
    font-size: 16px;
    font-weight: 700;
    color: #3b82f6;
}

.question-text {
    font-size: 20px;
    color: #1f2937;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Options */
.options-container {
    display: grid;
    gap: 12px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.option-label:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    transform: translateX(4px);
}

.option-label input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-radio {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
    flex-shrink: 0;
}

.option-label input[type="radio"]:checked ~ .option-radio {
    border-color: #3b82f6;
    background: #3b82f6;
}

.option-label input[type="radio"]:checked ~ .option-radio::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.option-letter {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-right: 15px;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    font-size: 16px;
    color: #374151;
}

.option-label input[type="radio"]:checked ~ .option-text {
    font-weight: 600;
    color: #1f2937;
}

/* Submit Button */
#submit-exam-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 30px;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
}

#submit-exam-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.5);
}

/* Results Screen */
.result-header {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    margin: -40px -40px 30px -40px;
}

#result-trophy {
    font-size: 100px;
    margin-bottom: 20px;
}

#result-status-text {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 15px 0;
}

#result-percentage {
    font-size: 64px;
    font-weight: 700;
}

/* Score Grid */
.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.score-card {
    background: #f9fafb;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #3b82f6;
}

.score-card.correct { border-left-color: #10b981; }
.score-card.wrong { border-left-color: #ef4444; }
.score-card.unanswered { border-left-color: #f59e0b; }
.score-card.penalty { border-left-color: #6b7280; }

.score-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.score-value {
    font-size: 32px;
    font-weight: bold;
    color: #1f2937;
}

/* Detailed Results */
.results-section {
    margin-top: 40px;
}

.section-title {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3b82f6;
}

.result-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.result-card.card-correct {
    background: #f0fdf4;
    border-color: #10b981;
}

.result-card.card-wrong {
    background: #fef2f2;
    border-color: #ef4444;
}

.result-card.card-unanswered {
    background: #fffbeb;
    border-color: #f59e0b;
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.card-correct .status-badge {
    background: #10b981;
    color: white;
}

.card-wrong .status-badge {
    background: #ef4444;
    color: white;
}

.card-unanswered .status-badge {
    background: #f59e0b;
    color: white;
}

.question-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
}

.options-list {
    display: grid;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    background: white;
    border: 2px solid #e5e7eb;
}

.option-item.option-correct {
    background: #d1fae5;
    border-color: #10b981;
}

.option-item.option-wrong {
    background: #fee2e2;
    border-color: #ef4444;
}

.opt-indicator {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.option-correct .opt-indicator {
    background: #10b981;
    color: white;
}

.option-wrong .opt-indicator {
    background: #ef4444;
    color: white;
}

.answer-explanation {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.explanation-correct {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.explanation-wrong {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.explanation-unanswered {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* Action Buttons */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
}

.action-btn {
    padding: 15px 35px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.action-btn-secondary {
    background: #f3f4f6;
    color: #1f2937;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Loading Overlay */
.nexgen-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nexgen-loading-overlay.active {
    opacity: 1;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 18px;
    margin-top: 20px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .nexgen-exam-wrapper {
        padding: 10px;
    }
    
    .exam-screen {
        padding: 25px;
    }
    
    .exam-title {
        font-size: 28px;
    }
    
    .exam-info-grid {
        grid-template-columns: 1fr;
    }
    
    .score-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .exam-timer,
    #start-exam-btn,
    #submit-exam-btn,
    .result-actions {
        display: none !important;
    }
    
    .exam-screen {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .result-card {
        page-break-inside: avoid;
    }
}