:root {
    --primary-color: #4a6bff;
    --primary-light: #eef1ff;
    --secondary-color: #f8f9fa;
    --text-color: #2c3e50;
    --text-muted: #6c757d;
    --border-color: #e1e4e8;
    --correct-color: #4caf50;
    --wrong-color: #f44336;
    --unattempted-color: #9e9e9e;
    --hover-color: #3a56d4;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7ff;
    color: var(--text-color);
    line-height: 1.6;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Standard */
    min-height: 100vh;
    padding: 2rem 0;
}

/* Additional copy protection */
* {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}

/* Allow text selection in the explanation section */
.review-explanation {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

/* Instructions */
.instructions {
    background: var(--primary-light);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 0 5px 5px 0;
}

.instructions h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instructions ul {
    margin: 0.5rem 0 0 1.2rem;
    padding: 0;
}

.instructions li {
    margin-bottom: 0.25rem;
}

.fullscreen-notice {
    margin-top: 1rem;
    padding: 0.5rem;
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid var(--warning-color);
    font-size: 0.9rem;
}

.fullscreen-notice p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Navigation Buttons */
.navigation-btns {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-buttons-right {
    display: flex;
    gap: 1rem;
}

.progress-indicator {
    flex-grow: 1;
    max-width: 300px;
    margin: 0 1rem;
}

.progress-bar {
    height: 6px;
    background: var(--light-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.progress {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

#progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    display: block;
}

.nav-btn {
    padding: 0.6rem 1.2rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn:not(:disabled):hover {
    background: var(--border-color);
}

.submit-btn {
    background: var(--success-color);
    color: white;
    border: none;
}

.submit-btn:hover {
    background: #218838;
}

/* Results Screen */
.result-container {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.result-header h1 {
    color: var(--primary-color);
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#subject-name {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0;
}

.score-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.score-circle {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.circle-progress {
    position: relative;
    width: 200px;
    height: 200px;
}

.circle-chart {
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: var(--light-bg);
    stroke-width: 2;
}

.circle-fill {
    fill: none;
    stroke: var(--success-color);
    stroke-width: 2;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dasharray 1s ease-in-out;
}

.percentage {
    font-size: 2.5rem;
    font-weight: bold;
    fill: var(--text-color);
    text-anchor: middle;
    dominant-baseline: middle;
}

.score-details {
    max-width: 300px;
}

.score-details h2 {
    font-size: 1.8rem;
    margin: 0 0 1.5rem;
    color: var(--text-color);
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.stat i {
    width: 20px;
    text-align: center;
}

.stat.correct {
    color: var(--success-color);
}

.stat.wrong {
    color: var(--danger-color);
}

.stat.unattempted {
    color: var(--unattempted-color);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-light);
}

/* Review Section */
.review-container {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.review-container h3 {
    color: var(--text-color);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#review-questions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-item {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.review-question {
    font-weight: 500;
    margin-bottom: 1rem;
}

.review-answer {
    padding: 1rem;
    background: var(--white);
    border-radius: 5px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.review-correct {
    color: var(--success-color);
    font-weight: 500;
    margin-top: 0.5rem;
    display: block;
}

.review-explanation {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(40, 167, 69, 0.1);
    border-left: 3px solid var(--success-color);
    border-radius: 0 5px 5px 0;
    font-size: 0.95rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .subjects-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .quiz-header {
        flex-direction: column;
        text-align: center;
    }
    
    .quiz-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .navigation-btns {
        flex-direction: column;
    }
    
    .progress-indicator {
        max-width: 100%;
        margin: 0.5rem 0;
    }
    
    .nav-buttons-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .score-circle {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.subject-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.subject-card.coming-soon {
    opacity: 0.7;
    position: relative;
    overflow: hidden;
}

.subject-card.coming-soon::after {
    content: 'Coming Soon';
    position: absolute;
    top: 10px;
    right: -35px;
    background: var(--primary-color);
    color: white;
    padding: 2px 35px;
    transform: rotate(45deg);
    font-size: 0.75rem;
    font-weight: 500;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.subject-card h3 {
    margin: 0.5rem 0;
    color: var(--text-color);
    font-size: 1.3rem;
}

.subject-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.subject-card .btn {
    margin-top: auto;
    width: 100%;
    text-align: center;
}

.quiz-header {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.back-btn:hover {
    text-decoration: underline;
}

.quiz-title {
    flex-grow: 1;
    text-align: center;
}

.quiz-title h2 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--text-color);
}

.topic-selector {
    margin-top: 0.5rem;
}

.topic-selector label {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.quiz-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.timer, .question-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.timer {
    color: var(--danger-color);
}

.quiz-container {
    background: var(--white);
    border-radius: 0 0 10px 10px;
    padding: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.instructions {
    background-color: #f8f9ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
}

.instructions h3 {
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.instructions ul {
    padding-left: 1.5rem;
}

.instructions li {
    margin-bottom: 0.5rem;
}

.fullscreen-notice {
    margin-top: 1.5rem;
    padding: 0.8rem;
    background-color: #e3f2fd;
    border-radius: 5px;
    font-size: 0.9rem;
    border-left: 4px solid #2196f3;
}

.fullscreen-notice p {
    margin: 0;
}

/* Form Group Styling */
.form-group {
    margin: 1.5rem 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.2);
}

.btn {
    display: block;
    width: 200px;
    margin: 1.5rem auto;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--hover-color);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.timer {
    font-size: 1.2rem;
    font-weight: 500;
    color: #e74c3c;
}

.question-counter {
    background-color: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
}

#question-text {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option {
    padding: 1rem;
    background-color: var(--secondary-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.option:hover {
    background-color: #e9ecef;
    border-color: var(--primary-color);
}

.option.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.option.correct {
    background-color: var(--correct-color);
    color: white;
    border-color: var(--correct-color);
}

.option.wrong {
    background-color: var(--wrong-color);
    color: white;
    border-color: var(--wrong-color);
}

.navigation-btns {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.nav-btn {
    padding: 0.6rem 1.2rem;
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-btn:hover {
    background-color: #e9ecef;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn {
    background-color: #28a745;
}

.submit-btn:hover {
    background-color: #218838;
}

/* Results Screen */
.score-container {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background-color: #f8f9ff;
    border-radius: 8px;
}

.score-details {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.score-details p {
    font-size: 1.1rem;
}

#score {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Review Section */
.review-container {
    margin: 2rem 0;
}

.review-item {
    background-color: #f8f9ff;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.review-question {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.review-answer {
    margin-top: 0.5rem;
    padding: 0.8rem;
    background-color: #e9ecef;
    border-radius: 5px;
    font-size: 0.95rem;
}

.review-correct {
    color: var(--correct-color);
    font-weight: 500;
}

.review-explanation {
    margin-top: 0.8rem;
    padding: 0.8rem;
    background-color: #e8f5e9;
    border-left: 3px solid var(--correct-color);
    font-size: 0.95rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .score-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .navigation-btns {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-btn, .submit-btn {
        width: 100%;
    }
}
