* {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        bodyq1 {
            background-color: #f5f5f5;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }

        .quiz-container {
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 800px;
            padding: 30px;
            transition: all 0.3s ease;
        }
		
		.quiz-container h2 {
			color: #4a6baf;
            margin-bottom: 20px;
            font-size: 32px;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
		}

        .quiz-header {
            margin-bottom: 20px;
        }

        .progress-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .time-left {
            background-color: #f0f0f0;
            padding: 8px 15px;
            border-radius: 20px;
            font-weight: bold;
            color: #333;
        }

        .time-left.warning {
            color: #ff5722;
        }

        .time-left.critical {
            color: #f44336;
            animation: pulse 1s infinite;
        }

        @keyframes pulse {
            0% { opacity: 1; }
            50% { opacity: 0.5; }
            100% { opacity: 1; }
        }

        .progress-bar-container {
            width: 100%;
            height: 10px;
            background-color: #e0e0e0;
            border-radius: 5px;
            margin-bottom: 20px;
        }

        .progress-bar {
            height: 100%;
            border-radius: 5px;
            background-color: #4CAF50;
            width: 0%;
            transition: width 0.3s ease;
        }
		
		.progress-container {
            width: 100%;
            background-color: #f0f0f0;
            border-radius: 10px;
            margin: 20px 0;
            height: 20px;
            overflow: hidden;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #4CAF50, #8BC34A);
            border-radius: 10px;
            transition: width 1s ease-in-out;
            position: relative;
            overflow: hidden;
        }

        .progress-bar::after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, 
                            rgba(255,255,255,0.1) 0%, 
                            rgba(255,255,255,0.3) 50%, 
                            rgba(255,255,255,0.1) 100%);
            animation: shine 2s infinite;
        }

        @keyframes shine {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        .badges {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin: 20px 0;
            flex-wrap: wrap;
        }

        .badge {
            width: 60px;
            height: 60px;
            background-color: #fff;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            font-size: 24px;
        }

        .restart-btn {
            margin-top: 30px;
            background-color: #4a6baf;
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 50px;
            cursor: pointer;
            font-size: 18px;
            transition: all 0.3s;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }

        .restart-btn:hover {
            background-color: #3a5a9f;
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.2);
        }

        .restart-btn:active {
            transform: translateY(1px);
        }

        .celebration {
            position: absolute;
            width: 10px;
            height: 10px;
            background-color: #f00;
            border-radius: 50%;
            pointer-events: none;
            animation: fly 3s linear forwards;
        }

        @keyframes fly {
            0% {
                transform: translate(0, 0) rotate(0deg);
                opacity: 1;
            }
            100% {
                transform: translate(var(--tx), var(--ty)) rotate(720deg);
                opacity: 0;
            }
        }

        .question-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            margin-bottom: 20px;
        }

        .question-tab {
            width: 40px;
            height: 40px;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #f0f0f0;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: bold;
        }

        .question-tab:hover {
            background-color: #e0e0e0;
        }

        .question-tab.current {
            background-color: #4CAF50;
            color: white;
        }

        .question-tab.answered {
            background-color: #8BC34A;
            color: white;
        }

        .question-tab.unanswered {
            background-color: #f0f0f0;
        }

        h2 {
            margin-bottom: 20px;
            color: #333;
        }

        .options {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-bottom: 30px;
        }

        .option {
            padding: 15px;
            border: 1px solid #ddd;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.2s ease;
            background-color: #f9f9f9;
        }

        .option:hover {
            background-color: #f0f0f0;
        }

        .option.selected {
            background-color: #d4edda;
            border-color: #c3e6cb;
        }

        .option.correct {
            background-color: #d4edda;
            border-color: #c3e6cb;
        }

        .option.incorrect {
            background-color: #f8d7da;
            border-color: #f5c6cb;
        }

        .button-group {
            display: flex;
            gap: 10px;
        }

        button {
            background-color: #4CAF50;
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s;
            flex: 1;
        }

        button:hover {
            background-color: #45a049;
        }

        button:disabled {
            background-color: #cccccc;
            cursor: not-allowed;
        }

        button.secondary {
            background-color: #2196F3;
        }

        button.secondary:hover {
            background-color: #0b7dda;
        }

        button.danger {
            background-color: #f44336;
        }

        button.danger:hover {
            background-color: #d32f2f;
        }

        .result-container {
            text-align: center;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            position: relative;
            overflow: hidden;
        }
		
		.result-container::before {
            content: "";
            position: absolute;
            top: -50px;
            right: -50px;
            width: 200px;
            height: 200px;
            background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
            border-radius: 50%;
        }

        .result-container h2 {
            color: #4a6baf;
            margin-bottom: 20px;
            font-size: 32px;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
        }


        .score {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 20px;
			padding: 6px;
			border: 3px solid green;
			border-radius: 20px;
			box-shadow: 1px 0px 2px 0px;
        }
		
		.score-display {
            position: relative;
            margin: 30px auto;
            width: 200px;
            height: 200px;
            border-radius: 50%;
            background: #fff;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            animation: pulse 2s infinite alternate;
        }
		
		@keyframes pulse {
            0% { transform: scale(1); }
            100% { transform: scale(1.05); }
        }
		
		.score-display::before {
            content: "";
            position: absolute;
            inset: -10px;
            border-radius: 50%;
            border: 5px dashed #4CAF50;
            animation: rotate 20s linear infinite;
            z-index: -1;
        }

        @keyframes rotate {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .score-percentage {
            font-size: 48px;
            font-weight: bold;
            color: #4a6baf;
            margin-bottom: 5px;
        }

        .score-fraction {
            font-size: 20px;
            color: #666;
        }

        .score-message {
            font-size: 24px;
            margin: 20px 0;
            padding: 10px 20px;
            border-radius: 50px;
            display: inline-block;
        }

        .excellent {
            background-color: #4CAF50;
            color: white;
            animation: confetti 3s ease-in-out;
        }

        .good {
            background-color: #2196F3;
            color: white;
        }

        .average {
            background-color: #FFC107;
            color: #333;
        }

        .poor {
            background-color: #f44336;
            color: white;
        }

        @keyframes confetti {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }

        .stars {
            margin: 20px 0;
            font-size: 30px;
            color: gold;
            text-shadow: 0 0 5px rgba(0,0,0,0.3);
        }


        .current-status {
            background-color: #f9f9f9;
            padding: 15px;
            border-radius: 5px;
            margin-bottom: 20px;
            text-align: center;
        }

        .current-status p {
            margin: 5px 0;
            font-size: 16px;
        }

        .current-status .highlight {
            font-weight: bold;
            color: #4CAF50;
        }
		
		.question-image {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    display: block;
    margin: 0 auto 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.option-image {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
}

.option {
    display: flex;
    align-items: center;
}

.question-image-small {
    max-width: 100%;
    height: auto;
    max-height: 100px;
    display: block;
    margin: 5px 0;
    border-radius: 5px;
}

.option-image-small {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
}

.question-text, .option-text {
    display: inline-block;
}
.question-text {
	margin-bottom: 10px;
}

/* Ensure HTML elements like sub/sup don't break layout */
sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}

/* MathJax specific styles */
.MathJax {
    font-size: 1.1em;
}

/* Ensure math doesn't break option layout */
.option .MathJax {
    display: inline !important;
}

/* Better spacing for mathematical expressions */
.math-container {
    margin: 10px 0;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 5px;
}


        @media (max-width: 600px) {
            .quiz-container {
                padding: 15px;
            }

            h2 {
                font-size: 20px;
            }

            .option {
                padding: 12px;
            }

            .question-tab {
                width: 30px;
                height: 30px;
                font-size: 14px;
            }

            .button-group {
                flex-direction: column;
            }
			.score-display {
                width: 150px;
                height: 150px;
            }
            .score-percentage {
                font-size: 36px;
            }
            .score-fraction {
                font-size: 16px;
            }
            .score-message {
                font-size: 20px;
            }
			
			.question-image {
        max-height: 150px;
    }
    
    .option-image {
        width: 25px;
        height: 25px;
    }
        }