/* Globale Stile für Dashboards und Verwaltungsseiten */

/* Allgemeine Layouts */
.container { max-width: 1300px; margin: 0 auto; padding: 0 1em; }
.header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1em; margin-bottom: 2em; }
.card { background: #fff; padding: 2em; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); margin-bottom: 2em; }
.form-group { margin-bottom: 1.5em; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5em; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.75em; border: 1px solid #ced4da; border-radius: 4px; box-sizing: border-box; }
    


.header { 
    border-bottom: 1px solid #ddd; 
    padding-bottom: 1em; 
    margin-bottom: 2em; 
}
.header h1 { 
    margin-bottom: 0.2em; 
}

.dashboard-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 1.5rem; 
}

.card { 
    background-color: #fff; 
    border: 1px solid #e9ecef; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
    overflow: hidden; 
    margin-bottom: 1.5rem; /* Hinzugefügt für konsistenten Abstand */
}

.card > summary.card-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1rem 1.5rem; 
    background-color: #f8f9fa; 
    border-bottom: 1px solid #e9ecef; 
    cursor: pointer; 
    list-style: none; 
    gap: 1rem;
}

.card > summary.card-header::-webkit-details-marker { 
    display: none; 
}

.card > summary.card-header h3 { 
    margin: 0; 
    font-size: 1.2em; 
    font-weight: 600; 
    color: #343a40; 
    margin-right: auto;    
}

.card > summary.card-header::after { 
    content: '−'; 
    font-size: 1.8em; 
    font-weight: 300; 
    color: #007bff; 
    transition: transform 0.2s; 
    line-height: 1; 
}

.card:not([open]) > summary.card-header::after { 
    content: '+'; 
}

.card > .card-header-static { 
    padding: 1rem 1.5rem; 
    background-color: #f8f9fa; 
    border-bottom: 1px solid #e9ecef; 
}

.card > .card-header-static h3 { 
    margin: 0; 
    font-size: 1.2em; 
    font-weight: 600; 
    color: #343a40; 
}

.card-body { 
    padding: 1.5rem; 
    padding-top: 0.5rem; 
}

.card-body p.text-muted { 
    margin: 0; 
    padding-top: 1rem; 
}

.athleten-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.athleten-list-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1rem 0; 
    border-bottom: 1px solid #f1f1f1; 
}

.athleten-list-item:last-child { 
    border-bottom: none; 
    padding-bottom: 0; 
}

.athleten-name { 
    font-weight: 600; 
}

.card-actions { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 1rem; 
}

/* ===================================================================== */
/* === NEU & VERBESSERT: Einheitliches Design für Aktionen (Buttons & Links) === */
/* ===================================================================== */

/* Die Basis-Klasse für alle Aktionen. Ersetzt das alte .btn */
.btn-action, .btn {
    /* Layout & Abstände */
    display: inline-block;
    padding: 0.75em 1.25em;
    text-align: center;
    vertical-align: middle;
    
    /* Schrift */
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
    color: #ffffff; /* Standard-Textfarbe ist weiß */
    
    /* Aussehen */
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none !important; /* Entfernt Unterstreichung bei <a>-Tags */
    cursor: pointer;
    
    /* Verhalten */
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

/* Hover-Effekt für alle Aktionen */
.btn-action:hover, .btn:hover {
    opacity: 0.85;
    color: #ffffff;
    text-decoration: none;
}

/* Spezieller Stil für "Details"-Button, falls noch benötigt */
.btn-details {
    background-color: #f1f3f5;
    color: #495057;
    border-color: #dee2e6;
}
.btn-details:hover {
    color: #495057; /* Stellt sicher, dass die Textfarbe beim Hover nicht weiß wird */
}


.btn { 
    display: inline-block; 
    padding: 0.6em 1.2em; 
    border-radius: 6px; 
    text-decoration: none; 
    font-size: 0.95em; 
    font-weight: 500; 
    border: 1px solid transparent; 
    transition: all 0.2s; 
    text-align: center; 
}

/* Farb-Modifikatoren. Ersetzen die alten .btn-primary etc. */
.btn-primary { 
    background-color: #007bff; 
    border-color: #007bff; 
}

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

.btn-success { 
    background-color: #28a745; 
    border-color: #28a745; 
}

.btn-danger { 
    background-color: #dc3545; 
    border-color: #dc3545; 
}

.btn-info { 
    background-color: #17a2b8; 
    border-color: #17a2b8; 
}


.btn-primary:hover { 
    background-color: #0056b3; 
    border-color: #0056b3; 
}

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

.btn-details { 
    background-color: #f1f3f5; 
    color: #495057; 
    border-color: #dee2e6; 
}
.btn-details:hover { 
    background-color: #e9ecef; 
}

.btn-delete { 
    background-color: #f8d7da; 
    color: #721c24; 
    border-color: #f5c6cb; 
}

.btn-delete:hover { 
    background-color: #f1b0b7; 
}

@media (min-width: 992px) {
    .dashboard-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .card.full-width { 
        grid-column: 1 / -1; 
    }
}

/* --- NEU: Stile für Profilkarten & Tabellen --- */

.profile-columns-container {
    display: flex;
    flex-wrap: wrap; /* Lässt Spalten auf kleinen Bildschirmen umbrechen */
    gap: 2.5em;      /* Abstand zwischen den Spalten */
}

.profile-column {
    flex: 1;         /* Beide Spalten nehmen gleich viel Platz ein */
    min-width: 250px; /* Mindestbreite, bevor sie umbrechen */
}

.column-title {
    margin-top: 0;
    font-size: 1.1em;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.6em;
    margin-bottom: 0.6em;
}

.profile-list {
    list-style: none;
    padding: 0;
}

.profile-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.profile-list li:last-child {
    border-bottom: none;
}

.profile-list .label {
    font-weight: 600;
    color: #495057; /* Etwas weicheres Schwarz */
}

.profile-list .value {
    color: #007bff;
    font-weight: 500;
}

/* Allgemeine Tabellen-Stile (falls noch nicht global definiert) */
table {
    border-collapse: collapse;
    width: 100%;
}

table th, table td {
    border-bottom: 1px solid #e9ecef;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

table th {
    background-color: #f8f9fa; /* Passt zum Card-Header */
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    color: #6c757d;
}

table tr:hover {
    background-color: #fafcff;
}

/* 1. Styling für das Icon selbst */
.fc-event-icon {
    /* Der gewünschte weiße Hintergrund */
    background-color: white;

    /* Erzeugt einen Abstand um das Icon, wodurch die rechteckige Form entsteht */
    padding: 2px 2px;

    /* Macht den Hintergrund des Icons rund */
    border-radius: 4px;

    /* Optional: Ein feiner grauer Rand, damit man den Kreis auch auf hellen Events gut sieht */
    /* border: 1px solid #e0e0e0; */

    /* Stellt sicher, dass das Icon im Kreis zentriert ist */
    /* Passt die Größe an die Schriftgröße an */
    /* width: 1.5em;  height: 1.5em; */
    display: inline-flex;
    justify-content: center;
    align-items: center;
    
    /* Wichtig: Verhindert, dass das Icon "gequetscht" wird */
    flex-shrink: 0;

    /* Sorgt für etwas Abstand zum Event-Titel */
    margin-right: 6px;

    /* Verhindert, dass das Icon von anderen Elementen überdeckt wird */
    position: relative;
    z-index: 2;
}

/* 2. Stellt sicher, dass Icon und Titel auf einer Linie sind */
/* FullCalendar umschließt den Inhalt normalerweise mit dieser Klasse */
.fc-event-main-frame {
    display: flex;
    align-items: center;
}

.fc-event-main { white-space: normal !important; }
/* Stellt sicher, dass border-color und background-color korrekt angewendet werden */
/* Dies ist normalerweise in FullCalendar integriert, aber schadet nicht, es explizit zu erwähnen */
.fc-event {
    border-width: 2px;
    border-style: solid;
    padding-left: 5px; /* Optische Anpassung */
}

.fc-col-header-cell {
    background-color: #374151;
}

/* Hebt die Kopfzeile des heutigen Tages hervor */
.fc-col-header-cell.fc-day-today {
    background-color: #1d4ed8;
}
    
.fc-col-header-cell a {
    color: #ffffff;
}

/* =================================================================== */
/*   FullCalendar: Styling für den Tagesnummern-Bereich             */
/* =================================================================== */

/* Standard-Hintergrund für den Tagesnummern-Bereich */
.fc-daygrid-day-top {
    background-color: #f3f4f6; /* Hellgrau für normale Tage */
    border-radius: 4px 4px 0 0; /* Oben abgerundete Ecken für einen "Tab"-Look */
}

/* Hintergrund für Tage, die nicht zum aktuellen Monat gehören (blasser) */
.fc-day-other .fc-daygrid-day-top {
    background-color: #fafafa; /* Ein noch helleres, fast weißes Grau */
}

/* Textfarbe für die Nummern in anderen Monaten anpassen, damit sie verblasster wirken */
.fc-day-other .fc-daygrid-day-number {
    color: #b0b0b0;
}

/* Hintergrund für den heutigen Tag stark hervorheben */
.fc-day-today .fc-daygrid-day-top {
    background-color: #1d4ed8; /* Kräftiges Blau (wie im vorigen Beispiel) */
}

/* Textfarbe der Nummer für den heutigen Tag anpassen (weiß auf blauem Grund) */
.fc-day-today .fc-daygrid-day-number {
    color: #ffffff;
    font-weight: bold;
}

/* Verhindert, dass der blaue Rahmen des ganzen "heutigen" Tages sichtbar ist, da wir nur den Header wollen */
.fc-day-today {
    background-color: transparent !important; 
}

/* Stil für die Tagesnummern-Zeile in einer Zelle mit unserer Klasse */
.fc-daygrid-day.training-phase-day .fc-daygrid-day-top {
    /* Ein dicker Balken oben in der Farbe, die vom JS gesetzt wurde */
    border-top: 5px solid var(--phase-indicator-color);
    
    /* Etwas Platz, damit es nicht gequetscht aussieht */
    margin-top: -1px; /* Korrigiert eventuelle Lücken durch den Border */
    padding-top: 2px;
}

/* Optional: Titel der Phase in der Tageszelle anzeigen (subtil) */
.fc-daygrid-day.training-phase-day .fc-daygrid-day-top::after {
    content: attr(data-phase-title); /* Liest den Titel aus einem data-Attribut */
    display: block;
    font-size: 0.7em;
    color: #6c757d;
    text-align: right;
    margin-right: 5px;
    margin-top: -18px; /* Positioniert den Text neben der Tagesnummer */
}

/* =================================================================== */
/*   FullCalendar: CSS-Klassen für Trainingsphasen                   */
/* =================================================================== */

/* Basis-Styling für alle Phasen-Header */
.fc-daygrid-day-top.phase-header {
    border-radius: 4px 4px 0 0;
    color: white; /* Standard-Textfarbe für alle Phasen */
}


.calendar-hint {
    /* --- Layout und Abstände --- */
    padding: 1rem; /* Innenabstand für Luftigkeit */
    text-align: center; /* Zentriert den Text */
    
    /* --- Farben und Rahmen --- */
    background-color: #f8f9fa; /* Heller, neutraler Hintergrund */
    color: #6c757d; /* Weiche, graue Textfarbe (wie text-muted) */
    border-top: 1px solid #dee2e6; /* Feine Trennlinie zum Kalender */

    /* --- Typografie --- */
    font-size: 0.9em; /* Etwas kleinere Schriftgröße */
    font-style: italic; /* Kursiv, um es als Hinweis zu kennzeichnen */

    /* --- Abgerundete Ecken (wichtig!) --- */
    /* Dies stellt sicher, dass die unteren Ecken des Hinweises
       mit den abgerundeten Ecken der Card übereinstimmen. */
    border-bottom-left-radius: var(--bs-card-border-radius);
    border-bottom-right-radius: var(--bs-card-border-radius);
}

.calendar-hint strong {
    /* Hebt die wichtigen Teile des Hinweises hervor */
    color: #495057;
    font-style: normal; /* Hebt die Kursivschrift für die wichtigen Wörter auf */
}


.phase-header .fc-daygrid-day-number {
    color: white !important; /* Wichtig, um Standard-Styles zu überschreiben */
    font-weight: bold;
}

/* Base-Phase: Solides Fundament */
.phase-base {
    background-color: #0d6efd; /* Solides Blau */
}

/* Aufbau-Phase: Intensität steigt */
.phase-aufbau {
    background-color: #ffc107; /* Warnendes Gelb/Gold */
    color: #212529; /* Dunkler Text für besseren Kontrast auf Gelb */
}
.phase-aufbau .fc-daygrid-day-number {
    color: #212529 !important;
}

/* Taper-Phase: Reduzierung, Erholung */
.phase-taper {
    background-color: #0dcaf0; /* Entspanntes Cyan/Türkis */
}

/* Wettkampf-Phase: Fokus, Höhepunkt */
.phase-wettkampf {
    background-color: #dc3545; /* Aggressives Rot */
}

/* Urlaub: Keine Belastung */
.phase-urlaub {
    background-color: #198754; /* Entspanntes Grün */
}

/* Krank: Pause, ungeplant */
.phase-krank {
    background-color: #6c757d; /* Neutrales Grau */
    text-decoration: line-through; /* Optional: Text durchstreichen */
}

/* Layout für Kalender und Wochenspalte */
.calendar-wrapper { display: flex; gap: 1.5em; }
#calendar { flex: 1 1 auto; }
.week-summary-box { padding: 8px; background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 6px; text-align: center; display: flex; flex-direction: column; justify-content: center; flex-grow: 1; }
.week-summary-box .week-title { font-weight: bold; font-size: 1.1em; margin-bottom: 6px; }
.week-summary-box .week-stats { font-size: 0.95em; line-height: 1.5; font-weight: 500; }
.stat-km { color: #005a9e; }
.stat-min { color: #b34d00; }

/* Stile für das neue zweispaltige Grid-Layout */
.dashboard-grid-container {
    display: grid;
    /* Wir definieren zwei Spalten: die linke nimmt 1 Teil, die rechte 2 Teile des Raums ein */
    grid-template-columns: 1fr 2fr;
    gap: 2em; /* Abstand zwischen den Spalten */
    align-items: start; /* Sorgt dafür, dass die Spalten oben bündig sind */
}

/* Stile für die Spalten selbst, damit die Karten untereinander einen Abstand haben */
.dashboard-column-left,
.dashboard-column-right {
    display: flex;
    flex-direction: column;
    gap: 2em; /* Abstand zwischen den Karten in einer Spalte */
}

/* Stile für die Athleten-Liste (ähnlich wie in der laeufer/liste.html) */
.athleten-list { list-style: none; padding: 0; margin: 0; }
.athleten-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.athleten-list-item:last-child { border-bottom: none; }
.athlet-info { display: flex; flex-direction: column; }
.athlet-name { font-weight: 600; }
.athlet-email { font-size: 0.9em; color: #6c757d; }
.athlet-actions { display: flex; gap: 0.5em; align-items: center; }


/* ========================================================== */
/*   Angepasste Modal-Stile für flexibles, scrollbares Layout */
/* ========================================================== */

/* Modal-Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay.hidden {
    display: none;
}

/* 
  Anpassung für das Haupt-Modal-Fenster. 
  Dies war Ihr '.modal-content' Block.
*/
.modal-content {
    background: #fff;
    padding: 2em;
    border-radius: 8px;

    width: 90%;
    max-width: 600px;
    
    /* NEU: Schritt 1 - Maximale Höhe definieren.
       85vh (85% der Fensterhöhe) ist ein guter, sicherer Wert. */
    max-height: 85vh; 
    
    /* NEU: Schritt 2 - Das Modal zu einem vertikalen Flex-Container machen. */
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
    
    /* NEU: Stellt sicher, dass der Header nicht schrumpft. */
    flex-shrink: 0; 
}

/* NEU: Dies ist der entscheidende neue Block. */
/* Er umschließt den scrollbaren Bereich. */
.modal-body {
    /* NEU: Nimmt allen verfügbaren Platz ein. */
    flex-grow: 1;
    
    /* NEU: Fügt einen Scrollbalken hinzu, NUR wenn nötig. */
    overflow-y: auto; 
    
    /* NEU: Verhindert, dass der Inhalt direkt am Rand klebt, 
       besonders wenn der Scrollbalken erscheint. */
    padding-right: 15px; 
    margin-right: -15px; /* Gleicht das Padding aus, damit der Inhalt wieder zentriert ist */
}

/* Ihre bestehenden Header-Stile bleiben unverändert */
.modal-header h3 {
    margin: 0;
}

.modal-close-btn {
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
}

/* Ihre bestehenden Such- und Ergebnis-Stile bleiben unverändert */
.modal-search input {
    width: 100%;
    padding: 0.75em;
    margin-bottom: 1em;
    font-size: 1.1em;
    box-sizing: border-box;
}

.modal-results {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

.modal-results li {
    padding: 0.75em 1em;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.info-field {
    background-color: #f8f9fa;
    padding: 0.75em;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}
/* Styling für den Modal-Footer */
.modal-footer {
    margin-top: 1.5em;
    
    /* NEU: Stellt sicher, dass der Footer nicht schrumpft. */
    flex-shrink: 0; 

    border-top: 1px solid #e9ecef;
    padding-top: 1.5em;
    display: flex;
    justify-content: flex-end;
    gap: 0.75em;
}
/* Erhöht die Breite des Detail-Modals */
#event-details-modal .modal-content {
    max-width: 700px; /* Ändern Sie diesen Wert nach Bedarf, z.B. 700px, 900px */
}

/* Stile für die neue Workout-Detail-Tabelle im Modal */
.workout-details-table {
    width: 100%;
    border-collapse: collapse;
}

.workout-details-table th,
.workout-details-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top; /* Wichtig für mehrzeilige Inhalte */
}

.workout-details-table thead th {
    font-size: 0.85em;
    text-transform: uppercase;
    color: #6c757d;
    /* text-align: center;  */
    vertical-align: middle; /* Optional: Zentriert auch vertikal, falls unterschiedlich hohe Inhalte auftreten */    
}

/* Stellt sicher, dass die Zeilen in der Kopfzeile korrekt umbrechen */
.workout-details-table thead th div {
    line-height: 1.2;
}

/* Stile für Wiederholungs-Marker und Einrückungen */
.workout-details-table .repetition-marker td {
    background-color: #f8f9fa;
    padding: 8px 10px;
    font-weight: 600;
    color: #495057;
}

.workout-details-table .indented-segment td:first-child {
    padding-left: 30px;
}

/* Das Badge für die Zielzone */
.workout-details-table .zone-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.9em;
    font-weight: 600;
    border-radius: 12px;
    background-color: #e9ecef;
    color: #495057;
    white-space: normal; /* Erlaubt dem Text im Badge, umzubrechen */
}



/* Responsives Verhalten für kleinere Bildschirme */
@media (max-width: 992px) {
    .dashboard-grid-container {
        grid-template-columns: 1fr; /* Auf kleinen Bildschirmen nur eine Spalte */
    }
}

.messages-container {
    max-height: 100px;
    overflow-y: auto;
    padding: 5px 10px; 
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.message-bubble {
    width: fit-content; 
    max-width: 85%;
    /* WICHTIG: Explizit eine kompakte Zeilenhöhe setzen */
    line-height: 1.4; /* Verhindert übermäßigen Abstand zwischen Zeilen */
    
    /* ALT: padding: 6px 12px; */
    /* NEU: Nochmals reduziertes vertikales Padding */
    padding: 4px 10px;     border-radius: 15px;
    word-wrap: break-word;
    white-space: normal;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);    
}
.message-sent {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.message-received {
    background-color: #e9ecef;
    color: #212529;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.message-content {
    font-size: 0.9em;
    margin: 0;
}
.message-timestamp {
    font-size: 0.7em;
    text-align: right;
    margin-top: 1px; 
    opacity: 0.8;
    margin: 0;
}
.message-input-area {
    display: flex;
    margin-top: 10px;
    gap: 8px;
}
.message-input-area textarea {
    flex-grow: 1;
    min-height: 40px;
    resize: vertical;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
}
.no-messages {
    color: #6c757d;
    text-align: center;
    font-style: italic;
    padding: 20px 0;
}

/* ========================================================== */
/* === NEUE CSS-REGELN FÜR DEN AUSKLAPPBAREN WORKOUT-ABLAUF === */
/* ========================================================== */
.details-toggle-btn {
    background-color: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75em 1em;
    width: 100%;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1em;
    margin-top: 1.5em;
    transition: background-color 0.2s;
}

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

.details-toggle-btn .arrow {
    font-size: 0.8em;
    transition: transform 0.2s ease-in-out;
}

.details-toggle-btn.is-open .arrow {
    transform: rotate(90deg);
}

.workout-details-content {
    padding: 1em;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 6px 6px;
}


/* <!-- NEU: CSS-Regel, um den aktuell geladenen Plan optisch hervorzuheben --> */
tr.plan-active {
    background-color: #e6f0f8; /* Helles Blau, passend zu geplanten Events */
    font-weight: bold;
}   

/* Optional: Stellen Sie sicher, dass es auf kleineren Bildschirmen nicht zu breit wird */
@media (max-width: 900px) {
    #event-details-modal .modal-content {
        max-width: 90vw; /* 90% der Bildschirmbreite */
    }
}
/*
 * KORREKTUR: Diese Regel zielt auf das .form-check Element selbst ab.
 * Sie setzt jeglichen vererbten linken Abstand zurück, was den Versatz behebt.
 */
.form-group .form-check {
    padding-left: 0; /* Entfernt den unerwünschten Einzug */
}

/*
 * Diese Regeln erzwingen, dass die Checkboxen und Labels nebeneinander stehen.
 * Dies ist die wichtigste Regel. Sie macht den Container zu einer Flexbox.
 */
.form-check {
    display: flex;
    align-items: center; /* Vertikal zentrieren */
    margin-bottom: 0.5rem; /* Etwas Abstand nach unten */
}

/*
 * Diese Regel entfernt den oberen Rand des Inputs, der das Problem verursachen könnte,
 * und fügt rechts einen kleinen Abstand zum Text hinzu.
 */
.form-check-input {
    margin-top: 0;
    margin-left: 0; /* Sicherstellen, dass hier kein Abstand ist */
    margin-right: 0.6em;
}

/* static/css/main.css */

/* Breiteres Modal für den Editor */
.modal-content.modal-lg {
    max-width: 800px;
}

.workout-meta-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.section-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 1.5rem 0;
}

#workout-blocks-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.workout-block {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-control-small {
    width: 70px;
    text-align: center;
}

.segments-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.workout-segment {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 1rem;
    padding-right: 40px; /* Platz für den Löschen-Button */
    position: relative;
}

.segment-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.segment-notes {
    margin-top: 0.75rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #888;
    position: absolute;
    padding: 5px;
    line-height: 1;
}
.btn-icon:hover {
    color: #d9534f; /* Rote Farbe beim Hover */
}

.remove-block-btn {
    top: 0.5rem;
    right: 0.5rem;
}

.remove-segment-btn {
    top: 0.5rem;
    right: 0.5rem;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8em;
}

.btn-full-width {
    width: 100%;
    padding: 0.75rem;
    font-size: 1em;
}


.workout-details-table th,
.workout-details-table td {
    font-size: 0.8rem; /* Verringert die Schriftgröße (Standard ist oft 1rem) */
    padding: 8px 10px; /* Passt den Innenabstand der Zellen an (optional, aber empfohlen) */
    font-weight: 600; 
}

.workout-details-table .calculated-value {
    font-weight: 400; /* Setzt das Gewicht auf 'normal' zurück */
    font-style: italic; /* Macht den Text kursiv */
    color: #495057; /* Ein etwas gedämpfteres Grau für den Text */
}

.footer-button-group {
    display: flex;
    align-items: center;
    gap: 0.5em; /* Kleiner Abstand zwischen den Elementen */
    background-color: #f8f9fa; /* Leichter grauer Hintergrund */
    padding: 0.375rem 0.75rem; /* Innenabstand */
    border: 1px solid #dee2e6; /* Dünner grauer Rahmen */
    border-radius: 6px; /* Abgerundete Ecken */
}

/* NEU: Stil für das Label innerhalb der Gruppe */
.footer-button-group-label {
    font-weight: bold;
    font-size: 1rem;
    color: #212529;    /* Standard-Textfarbe */
    margin-right: 0.25em; /* Etwas mehr Abstand zum ersten Button */
}

    .activities-ul {
        list-style: none;
        padding: 0;
        margin: 0;
        max-height: 250px;
        overflow-y: auto;
    }
    .activities-ul li {
        padding: 0.8em 1.2em;
        border-bottom: 1px solid #e9ecef;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: background-color 0.2s ease-in-out;
    }
    .activities-ul li:last-child {
        border-bottom: none;
    }
    .activities-ul li:hover {
        background-color: #f8f9fa;
    }
    .activities-ul li.selected {
        background-color: #0d6efd; /* Bootstrap Primary Color */
        color: white;
        font-weight: 500;
    }
    .loader, .alert {
        text-align: center;
        padding: 2em;
        color: #6c757d;
    }
    .alert {
        padding: 1em;
        border: 1px solid transparent;
        border-radius: .25rem;
    }
    .alert-danger {
        color: #721c24;
        background-color: #f8d7da;
        border-color: #f5c6cb;
    }
    .hidden {
      display: none;
    }

/* ======================================== */
/* === Lade-Spinner für Buttons           === */
/* ======================================== */

/* Kleiner Spinner, der inline in Buttons passt */
.spinner-sm {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: -0.2em; /* Vertikal zentrieren */
    margin-right: 0.5em;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #ffffff; /* Farbe des rotierenden Teils */
    animation: spin 1s ease-in-out infinite;
    -webkit-animation: spin 1s ease-in-out infinite;
}

/* Die Rotations-Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
@-webkit-keyframes spin {
    to {
        -webkit-transform: rotate(360deg);
    }
}

#km-chart, #min-chart {
    height: 250px; /* Passen Sie diesen Wert nach Belieben an (z.B. 350px) */
}