/* webapp/css/style.css */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --border-radius: 0.25rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: var(--dark-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
    padding: 0 20px;
}

header {
    background: var(--dark-color);
    color: var(--light-color);
    padding: 1rem 0;
    border-bottom: 3px solid var(--primary-color);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 a {
    color: var(--light-color);
    text-decoration: none;
    font-size: 1.8rem;
}

header nav a {
    color: var(--light-color);
    text-decoration: none;
    margin-left: 15px;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

header nav a:hover {
    background-color: var(--secondary-color);
}
header nav span {
    margin-right: 15px;
}

main {
    flex-grow: 1;
    padding: 20px 0;
}

footer {
    background: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 1rem 0;
    margin-top: auto;
}

/* Flash Messages */
#flash-messages {
    margin-bottom: 1rem;
}
.flash {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}
.flash.success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.flash.error { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.flash.info { color: #0c5460; background-color: #d1ecf1; border-color: #bee5eb; }

/* Forms */
.auth-form, .course-selector {
    background: var(--light-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 500px;
    margin: 20px auto;
}
.auth-form h2, .course-selector h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}
.auth-form label, .course-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}
.auth-form input[type="email"],
.auth-form input[type="text"],
.course-selector select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    box-sizing: border-box;
}
.auth-form button, .course-selector button,
#learn-section button, .actions-dashboard button, .stat-card button {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    margin-right: 10px; /* Für mehrere Buttons nebeneinander */
    margin-bottom: 10px;
}
.auth-form button:hover, .course-selector button:hover,
#learn-section button:hover, .actions-dashboard button:hover, .stat-card button:hover {
    background: #0056b3;
}
#submit-auth { width: 100%; }
#form-helper-text {
    font-size: 0.9em;
    color: var(--secondary-color);
    text-align: center;
    margin-top: 10px;
}

/* Dashboard */
#dashboard-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--light-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border-left: 5px solid var(--info-color);
}
.stat-card h3 {
    margin-top: 0;
    color: var(--info-color);
}
.progress-bar-container {
    background-color: #e9ecef;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    height: 25px;
    overflow: hidden; /* Wichtig für abgerundete Ecken des inneren Balkens */
}
.progress-bar {
    background-color: var(--success-color);
    height: 100%;
    line-height: 25px; /* Vertikal zentrieren */
    color: white;
    text-align: center;
    font-weight: bold;
    white-space: nowrap;
    transition: width 0.6s ease;
    border-radius: var(--border-radius); /* Sorgt dafür, dass der innere Balken auch abgerundet ist */
}
.box-distribution {
    font-size: 0.9em;
}
.box-info {
    margin-bottom: 5px;
}
.box-info span {
    font-weight: bold;
    display: inline-block;
    min-width: 20px;
    text-align: right;
    margin-left: 5px;
}
.actions-dashboard {
    margin-top: 20px;
    text-align: center;
}
.actions-dashboard button {
    margin: 5px;
}


/* Learn Section / Flashcards */
#learn-section {
    max-width: 700px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
#exam-readiness-live {
    margin-bottom: 20px;
    text-align: center;
}
#exam-readiness-live p {
    font-size: 1.1em;
    margin-bottom: 0.5em;
}
.flashcard {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 20px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: var(--secondary-color);
}
#mark-difficult-btn {
    padding: 5px 10px;
    font-size: 0.8em;
    background-color: var(--warning-color);
    color: var(--dark-color);
}
#mark-difficult-btn.marked {
    background-color: var(--danger-color);
    color: white;
}
#card-question {
    font-size: 1.4em;
    margin-bottom: 20px;
    flex-grow: 1;
}
.options-list label {
    display: block;
    background-color: var(--light-color);
    padding: 10px;
    margin-bottom: 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 1px solid #eee;
    transition: background-color 0.2s;
}
.options-list label:hover {
    background-color: #e9ecef;
}
.options-list input[type="radio"],
.options-list input[type="checkbox"] {
    margin-right: 10px;
}
/* Feedback für Optionen */
.options-list label.correct {
    background-color: #d4edda !important; /* Wichtig, um Hover zu überschreiben */
    border-color: #c3e6cb !important;
    color: #155724;
}
.options-list label.incorrect {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24;
}
#card-explanation {
    margin-top: 20px;
    padding: 15px;
    background-color: #eef;
    border-left: 3px solid var(--info-color);
    border-radius: var(--border-radius);
}
.card-actions {
    margin-top: 20px;
    text-align: center;
}
#reveal-answer-btn {
    width: 60%;
}
#session-summary {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

/* Exam Simulation */
#exam-simulation-container {
    /* Ähnlich wie Learn Section */
}
#exam-question-area .question-block {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ccc;
}
#exam-question-area .question-block:last-child {
    border-bottom: none;
}
#exam-results {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
}
#exam-results .passed { color: var(--success-color); font-weight: bold; }
#exam-results .failed { color: var(--danger-color); font-weight: bold; }


/* Responsive Design (Mobile First in action) */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    header nav {
        margin-top: 10px;
    }
    header nav a {
        display: block;
        margin: 5px 0;
    }
    .dashboard-grid {
        grid-template-columns: 1fr; /* Single column on smaller screens */
    }
}

/* Helper classes */
.hidden {
    display: none !important;
}
button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
button:disabled:hover {
    background-color: #ccc;
}