/* Frontend styles for MCQ Test Creator 
   Version: 2.0 with Negative Marking Support
   Used by: Standalone results page and test runner
*/

/* ==================== BASE STYLES ==================== */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 40px; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ==================== RESULTS CONTAINER ==================== */
.mcq-results-container { 
    max-width: 800px; 
    margin: 0 auto; 
    background: white; 
    padding: 30px; 
    border-radius: 15px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); 
}

.mcq-results-title { 
    text-align: center; 
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

/* ==================== STUDENT INFO CARD ==================== */
.mcq-student-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.mcq-student-info-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: white;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding-bottom: 10px;
}

.mcq-student-info-card p {
    margin: 8px 0;
    color: rgba(255,255,255,0.95);
}

.mcq-student-info-card strong {
    color: white;
}

/* ==================== STATISTICS SUMMARY ==================== */
.mcq-stats-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.mcq-stats-summary h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.mcq-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.mcq-stat-box {
    background: white;
    padding: 18px 12px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.mcq-stat-box:hover {
    transform: translateY(-3px);
}

.mcq-stat-box.attempted {
    border-top: 3px solid #2196f3;
}

.mcq-stat-box.unattempted {
    border-top: 3px solid #ff9800;
}

.mcq-stat-box.correct {
    border-top: 3px solid #4caf50;
}

.mcq-stat-box.wrong {
    border-top: 3px solid #f44336;
}

.mcq-stat-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mcq-stat-value {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
}

.mcq-stat-percent {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

/* ==================== TOTAL SCORE SECTION ==================== */
.total-score {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
}

.score-main {
    text-align: center;
    color: white;
    font-size: 18px;
}

.score-number {
    font-size: 48px;
    margin: 15px 0;
}

.score-number strong {
    color: #ffd700;
    font-size: 60px;
}

.score-percentage {
    font-size: 20px;
    opacity: 0.9;
}

.score-details {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.score-breakdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.score-breakdown span {
    font-size: 14px;
}

.score-details small {
    font-size: 12px;
    opacity: 0.8;
    display: block;
}

/* ==================== NEGATIVE MARKING NOTICE ==================== */
.negative-marking-notice {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid #ffb74d;
    border-radius: 8px;
    padding: 12px 20px;
    margin: -10px 0 20px 0;
    font-size: 14px;
    color: #e65100;
    text-align: center;
    font-weight: 500;
}

/* ==================== RESULT ITEMS ==================== */
.mcq-result-item { 
    border: 1px solid #ddd; 
    margin-bottom: 20px; 
    padding: 20px; 
    border-radius: 10px; 
    transition: all 0.3s ease;
    position: relative;
}

.mcq-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.mcq-result-item.correct { 
    border-left: 5px solid #4CAF50; 
    background: linear-gradient(135deg, #f9fff9 0%, #e8f5e9 100%);
}

.mcq-result-item.incorrect { 
    border-left: 5px solid #f44336; 
    background: linear-gradient(135deg, #fff9f9 0%, #ffebee 100%);
}

.mcq-result-item.unattempted {
    border-left: 5px solid #ff9800;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
}

.mcq-result-item.negative {
    border-left: 5px solid #ff9800;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
}

/* ==================== QUESTION HEADER ==================== */
.mcq-question-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.question-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #f0f0f0;
    color: #666;
}

.mcq-result-item.correct .question-status {
    background: #4caf50;
    color: white;
}

.mcq-result-item.incorrect .question-status {
    background: #f44336;
    color: white;
}

.mcq-result-item.unattempted .question-status {
    background: #ff9800;
    color: white;
}

.mcq-result-item.negative .question-status {
    background: #ff9800;
    color: white;
}

.mcq-result-question { 
    font-weight: bold; 
    margin: 0; 
    font-size: 18px;
    color: #333;
    flex: 1;
}

/* ==================== QUESTION MARK BADGE ==================== */
.question-mark { 
    float: right; 
    background: #eee; 
    padding: 5px 12px; 
    border-radius: 20px; 
    font-weight: bold; 
    font-size: 14px;
}

.question-mark.correct { 
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white; 
}

.question-mark.incorrect { 
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white; 
}

.question-mark.unattempted { 
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white; 
}

.question-mark.negative { 
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white; 
}

/* ==================== OPTIONS STYLES ==================== */
.mcq-result-options { 
    margin: 15px 0; 
}

.mcq-result-option { 
    display: block; 
    padding: 10px 15px; 
    margin: 8px 0; 
    border-radius: 8px; 
    transition: all 0.2s ease;
}

.correct-answer { 
    background-color: #e8f5e9; 
    border: 1px solid #4CAF50; 
    box-shadow: 0 1px 3px rgba(76, 175, 80, 0.2);
}

.user-correct { 
    background-color: #c8e6c9; 
    border: 2px solid #4CAF50;
    font-weight: 500;
}

.user-incorrect { 
    background-color: #ffcdd2; 
    text-decoration: line-through;
    border: 2px solid #f44336;
}

/* ==================== FEEDBACK STYLES ==================== */
.mcq-result-feedback { 
    padding: 12px 15px; 
    border-radius: 8px; 
    margin-top: 10px;
    background: rgba(0,0,0,0.02);
}

.correct-text { 
    color: #4CAF50; 
    font-weight: 600;
}

.incorrect-text { 
    color: #f44336; 
    font-weight: 600;
}

.unattempted-text {
    color: #ff9800;
    font-weight: 600;
}

.correct-answer-hint {
    margin-top: 8px;
    padding: 8px;
    background: #e8f5e9;
    border-radius: 5px;
    font-size: 13px;
    color: #2e7d32;
}

/* ==================== DETAILED REVIEW SECTION ==================== */
.mcq-detailed-review {
    margin-top: 30px;
}

.mcq-detailed-review h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

/* ==================== TEST CONTAINER ==================== */
.mcq-test-container { 
    margin: 20px auto; 
    max-width: 900px; 
}

/* ==================== TEST OVERVIEW ==================== */
.mcq-test-overview {
    text-align: center;
    max-width: 650px;
    margin: 40px auto;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    animation: fadeIn 0.5s ease;
}

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

.mcq-test-overview h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 600;
}

/* ==================== TEST INFO GRID ==================== */
.mcq-test-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.mcq-info-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #4caf50;
    text-align: center;
    transition: transform 0.2s ease;
}

.mcq-info-item:hover {
    transform: translateY(-3px);
}

.mcq-info-label {
    display: block;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mcq-info-value {
    font-size: 28px;
    color: #333;
    font-weight: bold;
}

.mcq-info-value small {
    font-size: 14px;
    font-weight: normal;
    display: block;
    margin-top: 5px;
    color: #666;
}

/* ==================== START BUTTON ==================== */
.mcq-start-button {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 15px 35px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.mcq-start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.mcq-start-button:active {
    transform: translateY(0);
}

/* ==================== TEST FORM ==================== */
.mcq-test-form {
    background: white;
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    animation: slideIn 0.5s ease;
}

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

.mcq-test-form h3 {
    color: #5f6368;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

/* ==================== STUDENT INFO SECTION ==================== */
.mcq-student-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid #2196f3;
}

.mcq-student-info h3 {
    margin-top: 0;
    color: #333;
    margin-bottom: 20px;
    border-bottom: none;
    padding-bottom: 0;
}

.mcq-student-info p {
    margin-bottom: 15px;
}

.mcq-student-info label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.mcq-student-info input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.mcq-student-info input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* ==================== QUESTIONS SECTION ==================== */
.mcq-questions {
    margin-top: 30px;
}

.mcq-questions h3 {
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    font-size: 24px;
}

.mcq-question {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #2196f3;
    transition: all 0.3s ease;
}

.mcq-question:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.mcq-question-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.4;
}

/* ==================== OPTIONS ==================== */
.mcq-options {
    margin-top: 15px;
}

.mcq-option {
    display: block;
    padding: 12px 20px;
    margin: 10px 0;
    border: 2px solid #dadce0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
    font-size: 15px;
}

.mcq-option:hover {
    background-color: #e8f0fe;
    border-color: #2196f3;
    transform: translateX(5px);
}

.mcq-option input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.mcq-option input[type="radio"]:checked + span {
    font-weight: bold;
    color: #1976d2;
}

.mcq-option:has(input:checked) {
    background-color: #e3f2fd;
    border-color: #2196f3;
    box-shadow: 0 2px 5px rgba(33, 150, 243, 0.2);
}

/* ==================== TIMER STYLES ==================== */
.mcq-timer-container {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    font-size: 20px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

#mcq-timer {
    color: #4caf50;
    transition: color 0.3s ease;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

#mcq-timer.warning {
    color: #ff9800;
    animation: pulse 1s infinite;
}

#mcq-timer.danger {
    color: #f44336;
    animation: pulse 0.5s infinite;
}

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

/* ==================== SUBMIT BUTTON ==================== */
.mcq-submit-button {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s ease;
    display: inline-block;
    width: auto;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.mcq-submit-button:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.mcq-submit-button:active {
    transform: translateY(0);
}

.mcq-clear-button {
    background: #f44336;
    color: white;
    padding: 12px 24px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.mcq-clear-button:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* ==================== PROGRESS BAR ==================== */
.mcq-progress {
    margin: 20px 0;
    background: #f0f0f0;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}

.mcq-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #45a049);
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* ==================== FORM INPUTS ==================== */
.mcq-test-form input[type="text"], 
.mcq-test-form input[type="email"] { 
    width: 100%; 
    padding: 12px 15px; 
    margin: 6px 0 15px; 
    box-sizing: border-box;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.mcq-test-form input[type="text"]:focus,
.mcq-test-form input[type="email"]:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* ==================== AUTO-SAVE NOTICE ==================== */
.mcq-auto-save-notice {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

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

/* ==================== HELPER CLASSES ==================== */
.mcq-unanswered {
    border-left: 4px solid #ff6b6b;
    background-color: #fff5f5;
}

.mcq-selected {
    background-color: #e3f2fd !important;
    border-color: #2196f3 !important;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    body {
        margin: 20px;
    }
    
    .mcq-results-container {
        padding: 20px;
    }
    
    .mcq-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .mcq-stat-value {
        font-size: 24px;
    }
    
    .mcq-test-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .mcq-timer-container {
        top: 10px;
        right: 10px;
        font-size: 16px;
        padding: 8px 15px;
    }
    
    .mcq-test-overview {
        padding: 25px;
        margin: 20px auto;
    }
    
    .mcq-info-value {
        font-size: 22px;
    }
    
    .mcq-test-form {
        padding: 20px;
    }
    
    .mcq-question {
        padding: 18px;
    }
    
    .mcq-question-text {
        font-size: 16px;
    }
    
    .mcq-option {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .question-mark {
        float: none;
        display: inline-block;
        margin-bottom: 10px;
    }
    
    .mcq-result-question {
        padding-right: 0;
    }
    
    .score-number strong {
        font-size: 40px;
    }
    
    .score-breakdown {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
    
    .mcq-question-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mcq-clear-button {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    body {
        margin: 0;
        background: white;
    }
    
    .mcq-timer-container,
    .mcq-start-button,
    .mcq-submit-button,
    .mcq-clear-button {
        display: none;
    }
    
    .mcq-test-overview,
    .mcq-test-form {
        box-shadow: none;
        padding: 0;
    }
    
    .mcq-result-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .mcq-student-info-card {
        background: #f0f0f0;
        color: #333;
        break-inside: avoid;
    }
    
    .mcq-student-info-card h3 {
        color: #333;
    }
    
    .total-score {
        background: #f0f0f0;
        color: #333;
        border: 1px solid #ddd;
    }
    
    .score-number strong {
        color: #333;
    }
    
    .mcq-stat-box {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mcq-result-item {
    animation: slideUp 0.4s ease forwards;
}

.mcq-result-item:nth-child(1) { animation-delay: 0.1s; }
.mcq-result-item:nth-child(2) { animation-delay: 0.2s; }
.mcq-result-item:nth-child(3) { animation-delay: 0.3s; }
.mcq-result-item:nth-child(4) { animation-delay: 0.4s; }
.mcq-result-item:nth-child(5) { animation-delay: 0.5s; }
.mcq-result-item:nth-child(6) { animation-delay: 0.6s; }
.mcq-result-item:nth-child(7) { animation-delay: 0.7s; }
.mcq-result-item:nth-child(8) { animation-delay: 0.8s; }
.mcq-result-item:nth-child(9) { animation-delay: 0.9s; }
.mcq-result-item:nth-child(10) { animation-delay: 1.0s; }