@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

:root {
    --primary: #4373bb;
    --background: #e8edf7;

    --success-bg: #dff6dd;
    --success: #12a10d;
    --success-dark: #0e7a0a;

    --error-bg: #fde7e9;
    --error: #bc2f32;

    --text: #242424;
    --text-muted: #bdbdbd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    min-height: 100vh;
    padding: 20px;
    background: #87a5d3 url(./bg-image.png) no-repeat top / cover;

    display: flex;
    justify-content: center;

    font-family: "Rubik", sans-serif;
    color: var(--text);
}

header {
    padding: 18px 50px;
    background-color: var(--primary);

    font-size: 20px;
    color: white;
}

.container {
    width: 700px;
    height: fit-content;
    border-radius: 4px;
    background-color: var(--background);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.menu,
.quiz,
.results {
    padding: 50px 44px 90px;
    display: none;
}

.active {
    display: block;
}

h2 {
    color: var(--primary);
}

.topic-btn {
    margin: 10px 0;
    padding: 12px;
    width: 100%;
    border: none;
    border-radius: 8px;

    display: block;

    background-color: var(--primary);

    color: white;
    font-size: 16px;

    cursor: pointer;
    transition: 0.2s;
}

.topic-btn:hover {
    filter: brightness(0.9);
}

form,
#resultDetails {
    margin-top: 60px;

    display: flex;
    flex-direction: column;
    gap: 70px;
}

.quiz-results {
    margin-top: 20px;
    justify-self: flex-end;
}

.quiz-results__result {
    color: var(--primary);
}

.restart-btn {
    margin-top: 50px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    
    background-color: var(--primary);
    
    justify-self: flex-end;
    display: block;

    font-size: 16px;
    color: #fff;

    cursor: pointer;
    transition: background 0.2s;
}

.restart-btn:hover {
    background-color: #365f9e;
}

.question {
    position: relative;
}

.question p {
    color: var(--text);
}

.answers {
    margin-top: 20px;
    margin-left: 20px;

    display: flex;
    flex-direction: column;
    gap: 20px;
}

.answers label {
    display: flex;
    align-items: center;

    font-size: 14px;
    cursor: pointer;
}

.answers input {
    margin-right: 6px;
}

.answers svg {
    margin-left: 15px;
    width: 15px;
    height: 15px;
    color: var(--success);
}

.timer {
    font-weight: 500;
    font-size: 16px;
    text-align: right;
}

.timer span:first-child {
    color: var(--text);
}

.timer span:last-child {
    color: var(--primary);
}

.submit-btn {
    margin-top: 50px;
    padding: 12px;
    border: none;
    width: 100%;
    border-radius: 8px;

    background-color: var(--primary);

    font-size: 16px;
    color: white;

    cursor: pointer;
}

.submit-btn:hover {
    filter: brightness(0.9);
}

.correct {
    background-color: #d4edda;
    border: 1px solid #28a745;
}

.incorrect {
    background-color: #f8d7da;
    border: 1px solid #dc3545;
}

.result-summary {
    /* width: 240px; */
    /* height: 40px; */
    padding: 7px 20px;
    border-radius: 99px;

    display: flex;
    align-items: center;
    gap: 5px;

    position: absolute;
    top: -40px;
    left: 0;
}

.result-summary svg {
    width: 20px;
    height: 20px;
}

.result-summary .result-summary__text {
    font-weight: 700;
}

.result-summary .result-summary__points {
    margin-left: 15px;
    font-weight: 300;
}

.result-summary--correct {
    background-color: var(--success-bg);
}

.result-summary--correct svg,
.result-summary--correct .result-summary__text {
    color: var(--success-dark);
}

.result-summary--correct .result-summary__points {
    color: var(--success);
}

.result-summary--incorrect {
    background-color: var(--error-bg);
    color: var(--error);
}

svg {
    width: 20px;
    height: 20px;
}

/* Modal */
.modal {
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);

    display: flex;
    justify-content: center;
    align-items: center;

    position: fixed;
    top: 0;
    left: 0;

    visibility: hidden;

    opacity: 0;
    transition: 0.3s;

    z-index: 1000;
}

.modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    padding: 20px 30px;
    width: 90%;
    max-width: 400px;
    border-radius: 10px;

    background-color: #fff;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.modal-content button {
    margin-top: 15px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background-color: var(--primary);

    color: #fff;
    cursor: pointer;
}