:root {
    --gray: #EEE;
    --ok: #4DAD45;
    --not-ok: #EC2232;
    --navigation: color-mix(in srgb, var(--gray), black 20%);
}

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

@keyframes correctFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

body {
    font-family: Poppins, sans-serif;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-weight: 700;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f5f5, #ffffff);
}

main {
    width: 100%;
    max-width: 1200px;
    height: auto;
    padding: 15px;
    box-sizing: border-box;
}

.quiz-container {
    box-sizing: border-box;
    background-color: white;
    border-radius: 20px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.question-answer-wrapper {
    display: flex;
    flex-direction: row;
    column-gap: 5vw;
    min-height: 65vh;
}

.quiz-container .question-wrapper {
    text-align: left;
    color: #000000;
    width: 50%;
}

.question {
    font-size: 2rem;
    line-height: 1.3;
    animation: fadeIn .8s ease;
}

.quiz-container .question-wrapper .questions-counter .max-possible-score{
    font-size: 1rem;
}

.quiz-container .question-wrapper .question {
    padding: 0;
    margin: 0;
}

.quiz-container .answers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 50%;
}

.quiz-container .answers button {
    color: black;
    background-color: var(--gray);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 400;
    padding: 10px;
    min-height: 6rem;
    font-family: Poppins;
    width: 100%;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    animation: fadeIn 0.3s ease;
    transition: all 0.2s ease;
}

.quiz-container .answers button.correct {
    background-color: var(--ok);
    color: white;
    animation: correctFlash 0.3s ease;
}

.quiz-container .answers button.incorrect {
    background-color: var(--not-ok);
    color: white;
    animation: shake 0.3 ease;
}

.quiz-container .answers button:hover {
    transform: translateY(-3px) scale(1.02);
    background-color: lightgray;
}

.quiz-container .answers button:active {
    transform: scale(0.97);
}

.quiz-container .navigation {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 15px;
}

.navigation p {
    text-align: left;
    padding: 0;
    margin: 0;
}

.quiz-container .navigation .nav-button {
    background-color: var(--navigation);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 400;
    height: 3rem;
    padding: 10px;
    margin: 10px 0 0 0;
    width: 10ch;
    align-self: flex-end;
    display: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.quiz-container .navigation .nav-button:hover {
    transform: translateY(-2px);
    filter: brightness(0.95);
}

.quiz-container .navigation .nav-button.visible {
    display: block;
}

.questions-counter {
    color: gray;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.score {
    font-size: 1.2rem;
    color: #333;
}

.timer {
    color: var(--not-ok);
    animation: pulse 0.6s infinite;
}

@media (max-width: 768px) {
    .question-answer-wrapper {
        flex-direction: column;
    }
    
    .quiz-container .question-wrapper {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .question {
        font-size: 1.5rem;
    }
    
    .quiz-container .answers {
        width: 100%;
    }
    
    .quiz-container .answers button {
        font-size: 1.2rem;
        min-height: 4rem;
    }
    
    .quiz-container .navigation {
        flex-wrap: wrap;
    }
    
    .quiz-container .navigation .nav-button {
        font-size: 1.2rem;
        height: 2.5rem;
        width: 8ch;
    }
}

@media (max-width: 480px) {
    .quiz-container {
        max-width: 95vw;
        margin: 0 auto;
    }
    
    .question {
        font-size: 1.5rem;
    }
    
    .quiz-container .answers button {
        font-size: 1.2rem;
        min-height: 3.5rem;
        padding: 8px;
    }
    
    .quiz-container .navigation .nav-button {
        font-size: 1.2rem;
        min-width: fit-content;
    }
    
    .questions-counter {
        font-size: 0.9rem;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .question-answer-wrapper {
        flex-direction: row;
        min-height: auto;
    }
    
    .quiz-container .question-wrapper {
        width: 40%;
    }
    
    .quiz-container .answers {
        width: 60%;
    }
    
    .question {
        font-size: 1.2rem;
    }
}