/* public/css/style.css */

/* Grundlegende Stile */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f8ff;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Hauptcontainer */
.app-container {
    width: 100%;
    max-width: 800px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px 30px;
}

h1 {
    color: #005a9e;
    margin-bottom: 25px;
    text-align: center;
}

/* --- Stile für die Hauptmenü-Seite --- */
.category-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.category-link {
    display: block;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.category-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    border-color: #005a9e;
}

.category-link h2 {
    margin: 0 0 5px 0;
    color: #005a9e;
}

.category-link p {
    margin: 0;
    font-size: 0.9em;
    color: #555;
}

/* --- Stile für die Übungs-Seite --- */
.exercise-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.back-link {
    align-self: flex-start;
    text-decoration: none;
    color: #007bff;
    margin-bottom: 15px;
    font-weight: bold;
}

#word-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 600px) {
    #word-container {
        grid-template-columns: 1fr 1fr;
    }
    .category-menu {
        grid-template-columns: 1fr 1fr;
    }
}

.word-pair {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid #ddd;
    gap: 10px;
}

.word-pair .question-word {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.word-pair .options-wrapper {
    display: flex;
    justify-content: space-around;
    width: 100%;
}

.word-option {
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    font-size: 1.1em;
    transition: all 0.2s ease-in-out;
    user-select: none;
    flex-grow: 1;
    text-align: center;
    margin: 0 5px;
}

.word-option:hover { background-color: #eef; }
.word-option.selected { border-color: #005a9e; background-color: #e0eaff; }
.word-option.correct { background-color: #d4edda; border-color: #c3e6cb; color: #155724; }
.word-option.correct::after { content: ' ✓'; font-weight: bold; }
.word-option.incorrect { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; }
.word-option.incorrect::after { content: ' ✗'; font-weight: bold; }

.button-container {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
}

#check-button { background-color: #28a745; color: white; }
#next-page-button { background-color: #007bff; color: white; }
.btn:disabled { background-color: #cccccc; cursor: not-allowed; opacity: 0.7; }

#result-container {
    margin-top: 20px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #005a9e;
    height: 30px;
}

/* --- Styles for the 1x1 Trainer --- */
.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #007bff;
    transition: width 0.4s ease-in-out;
}

#problem-area h2 {
    font-size: 3em;
    margin-bottom: 30px;
    color: #343a40;
    text-align: center;
}

#answer-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.answer-btn {
    font-size: 1.5em;
    padding: 15px 30px;
    min-width: 100px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
}

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

.answer-btn.correct {
    background-color: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

.answer-btn.incorrect {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}

.answer-btn.correct-missed {
    box-shadow: 0 0 0 3px #28a745;
}

.result-view {
    text-align: center;
    padding: 40px 0;
}

.result-view h2 {
    font-size: 2em;
    margin-bottom: 30px;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

#restart-button {
    background-color: #007bff;
    color: white;
}

#restart-button:hover {
    background-color: #0056b3;
}

/* --- Stile für den Satz-Trainer --- */
.description-text {
    text-align: center;
    font-size: 1.1em;
    color: #6c757d;
    margin-top: -15px;
    margin-bottom: 30px;
}

#sentence-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sentence-btn {
    width: 100%;
    text-align: left;
    font-size: 1.2em;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    line-height: 1.5;
}

.sentence-btn.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

#result-title {
    margin-bottom: 25px;
}

#result-details {
    text-align: left;
    margin-bottom: 30px;
}

.result-detail-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
}

.result-detail-item p {
    margin: 5px 0;
    font-size: 1.1em;
}

.correct-text {
    color: #155724;
    font-weight: bold;
}

.incorrect-text {
    color: #721c24;
    font-weight: bold;
    text-decoration: line-through;
}

#result-score {
    font-size: 1.5em;
    font-weight: bold;
    color: #005a9e;
    margin-bottom: 25px;
}

/* Färbt den ausgewählten Button grün/rot */
.sentence-btn.correct, .sentence-btn.incorrect {
    color: white;
    border-color: transparent;
}
.sentence-btn.correct {
    background-color: #28a745;
}
.sentence-btn.incorrect {
    background-color: #dc3545;
}

/* Hebt die eigentlich richtige Antwort hervor, wenn falsch geklickt wurde */
.sentence-btn.was-correct {
    box-shadow: 0 0 0 3px #28a745;
}