body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0f8ff, #d6f5e3);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background: white;
    padding: 30px 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 360px;
    text-align: center;
    transition: 0.3s ease-in-out;
}

.container:hover {
    transform: scale(1.02);
}

h2 {
    color: #2e8b57;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ---------- Input Fields ---------- */
input {
    width: 90%;
    padding: 12px;
    margin: 12px 4px;
    border: 1px solid #ccc;
    border-radius: 8px;
    transition: 0.2s;
    font-size: 14px;
}

input:focus {
    border-color: #2e8b57;
    outline: none;
    box-shadow: 0 0 5px rgba(46, 139, 87, 0.3);
}

/* ---------- Buttons ---------- */
button {
    width: 94%;
    padding: 12px;
    background-color: #2e8b57;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    background-color: #246b45;
    transform: translateY(-2px);
}

/* ---------- Links ---------- */
p {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #333;
}

a {
    color: #2e8b57;
    text-decoration: none;
    font-weight: bold;
    margin-left: 5px;
}

a:hover {
    text-decoration: underline;
}

/* ---------- Dashboard ---------- */
#dashboard-section {
    max-width: 400px;
}

#dashboard-section h3 {
    color: #333;
    font-weight: 500;
    margin-bottom: 20px;
}

#dashboard-section button {
    margin-top: 20px;
    width: 70%;
}

/* ---------- Quiz Section ---------- */
#quiz-section {
    max-width: 600px;
    width: 100%;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

#timer {
    font-size: 18px;
    font-weight: bold;
    color: #d9534f;
    margin-bottom: 20px;
}

#question-container {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #333;
}

/* ---------- Quiz Options ---------- */
#options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.option-btn {
    background-color: #f0f8ff;
    color: #2e8b57;
    border: 2px solid #2e8b57;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.option-btn:hover {
    background-color: #e0f0e8;
    transform: translateY(-2px);
}

.option-btn.selected {
    background-color: #2e8b57 !important;
    color: white !important;
}

/* ---------- Quiz Navigation ---------- */
.quiz-navigation {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.quiz-navigation button {
    width: 130px;
    background-color: white;
    color: #2e8b57;
    border: 2px solid #2e8b57;
    border-radius: 8px;
    padding: 10px 0;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

.quiz-navigation button:hover {
    background-color: #2e8b57;
    color: white;
}

.quiz-navigation button:disabled {
    background-color: #ccc;
    color: white;
    cursor: not-allowed;
}

/* ---------- NEW Result Section ---------- */
#result-section {
    display: none;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.result-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.logout-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    width: auto;
}

.logout-btn:hover {
    background: #5a6268;
}

.quiz-complete-text {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin: 20px 0;
}

/* ---------- Circular Progress ---------- */
.progress-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 30px auto;
}

.progress-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(#6f42c1 var(--percentage), #e9ecef var(--percentage));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-inner {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.percentage-text {
    font-size: 48px;
    font-weight: bold;
    color: #6f42c1;
}

/* ---------- Stats Table ---------- */
.stats-table {
    margin: 30px 0;
    width: 100%;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.stat-row:last-child {
    border-bottom: none;
    font-weight: bold;
}

.stat-label {
    color: #666;
    font-size: 16px;
}

.stat-value {
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

/* ---------- Action Buttons ---------- */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.btn-primary {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    width: auto;
}

.btn-primary:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6f42c1;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    width: auto;
}

.btn-secondary:hover {
    background: #5a32a3;
    transform: translateY(-2px);
}

/* ---------- Answer Review Section ---------- */
.answer-review {
    margin-top: 30px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    background: #f8f9fa;
}

.answer-review h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.question-review {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #6f42c1;
}

.question-review.correct {
    border-left-color: #28a745;
}

.question-review.incorrect {
    border-left-color: #dc3545;
}

.question-text {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.answer-line {
    margin: 5px 0;
    font-size: 14px;
}

.correct-answer {
    color: #28a745;
}

.wrong-answer {
    color: #dc3545;
}

.user-answer {
    color: #6f42c1;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .container,
    #quiz-section,
    #result-section {
        width: 95%;
        padding: 20px;
    }

    #options {
        flex-direction: column;
    }

    .option-btn {
        width: 100%;
    }

    .quiz-navigation button {
        width: 100px;
        font-size: 14px;
    }

    .progress-container {
        width: 150px;
        height: 150px;
    }

    .progress-circle {
        width: 150px;
        height: 150px;
    }

    .progress-inner {
        width: 120px;
        height: 120px;
    }

    .percentage-text {
        font-size: 36px;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-primary,
    .btn-secondary {
        width: 80%;
    }
}