/* Grundläggande återställning och layout */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* --- State-klasser (Nödvändiga för JS) --- */

.hidden {
    display: none !important;
}

/* --- Huvudinnehåll (Main) --- */

.container {
    max-width: 600px;
    width: 80%;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1,
h2 {
    color: #007bff;
}

hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #eee;
}

/* --- Formulär och Startskärm --- */

.selection-group {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: left;
}

.bold-label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

input[type="file"],
select {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#clear-quizzes-btn {
    /* Lägger till stil för rensa-knappen */
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9em;
}

#clear-quizzes-btn:hover {
    background-color: #c82333;
}

/* START-knappen */
#start-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 18px;
    margin: 10px 0;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#start-button:hover {
    background-color: #0056b3;
}

/* --- Spelplan (Game Screen) --- */

.question-text {
    min-height: 50px;
    margin: 20px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.content-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

/* Styling för flervalsknappar */
.option-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #007bff;
    background-color: #e6f0ff;
    color: #007bff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s, border-color 0.2s;
}

.option-btn:hover:not(:disabled) {
    background-color: #cce0ff;
}

.option-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Styling för skrivfält */
#answer-input {
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 6px;
    width: 90%;
    margin-bottom: 10px;
    font-size: 1em;
}

#submit-answer-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Feedback Area Styling */
.feedback-area {
    margin: 15px 0;
    padding: 15px;
    border-radius: 6px;
    font-weight: bold;
    transition: background-color 0.3s;
}

/* Nästa-knapp */
#next-btn {
    background-color: #f0ad4e;
    color: white;
    border: none;
    padding: 15px 30px;
    margin-top: 20px;
    font-size: 1.1em;
    border-radius: 6px;
    cursor: pointer;
}

#back-to-menu-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    font-size: 1em;
    border-radius: 6px;
    cursor: pointer;
}

/* --- Flashcard Styling --- */

#flashcard-container {
    width: 300px;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
    margin: 20px auto;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 15px;
    font-size: 1.5em;
    font-weight: bold;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-front {
    background-color: #fffacd;
    color: #444;
    border: 3px solid #ffd700;
}

.card-back {
    background-color: #90ee90;
    color: #444;
    border: 3px solid #3cb371;
    transform: rotateY(180deg);
}

/* --- Slutskärm (End Screen) --- */
.final-score {
    font-size: 1.8em;
    font-weight: bold;
    color: #007bff;
    margin: 20px 0;
}