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

/* ======================== */
/* KEYFRAMES ANIMATIONS     */
/* ======================== */

/* Animation für falsche Antworten - Shake-Effekt */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* Animation für richtige Antworten - Success-Bounce */
@keyframes successBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Pulse-Animation für Timer */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Fade-In für neue Fragen */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glow-Effekt für Buttons beim Hover */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(77, 173, 69, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(77, 173, 69, 0.6);
    }
}

/* Loading dots animation für Ladezustand */
@keyframes loadingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

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;
}

main {
    width: 100%;
    max-width: 1200px;
    height: auto;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

button.start {
    background-color: #ffeb13;
    border: 1px solid #ffffff;
    font-size: 3rem;
    width: 200px;
    height: 100px;
    font-weight: var(--bold);
    transition: transform 0.2s ease;
}

button.start:hover {
    cursor: pointer;
    transform: scale(1.05);
}

.quiz-container {
    box-sizing: border-box;
    background-color: white;
    border-radius: 20px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    width: 100%;
}

/* ********* */
/* QUESTIONS */

.question-answer-wrapper {
    display: flex;
    flex-direction: row;
    column-gap: 5vw;
    min-height: 65vh;
    /* Animation beim Laden neuer Fragen */
    animation: fadeInUp 0.5s ease-out;
}

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

.question {
    font-size: 2rem;
}

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

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

/* Timer Animation (Pulse) */
.timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: #EC2232;
    animation: pulse 2s ease-in-out infinite;
}

/* ******* */
/* ANSWERS */

.answers-wrapper {
    height: 50vh;
    width: 90%;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 10px;
    padding: 5vh 0px;
}

.answer {
    width: 100%;
    color: black;
    background-color: var(--gray);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
}

.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;
    transition: all 0.3s ease;
}

/* Hover-Effekt für Antwort-Buttons */
.quiz-container .answers button:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Richtige Antwort mit Success-Animation */
.quiz-container .answers button.correct {
    background-color: var(--ok);
    animation: successBounce 0.6s ease-out;
}

/* Falsche Antwort mit Shake-Animation */
.quiz-container .answers button.incorrect {
    background-color: var(--not-ok);
    animation: shake 0.5s ease-in-out;
}

/* Navigation */
.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: 5px;
    transition: all 0.3s ease;
}

.quiz-container .navigation .nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.quiz-container .navigation .nav-button.visible {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.hidden {
    display: none;
}

/* Responsive Design */
@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;
    }
}
