/* --- bestehender Inhalt oben bleibt --- */

body {
    font-family: sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 0;
}

main {
    max-width: 1200px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1, h2, h3 {
    color: #005A9F;
}

h3 {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

input, select, button {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

button {
    border: none;
    background-color: #005A9F;
    color: white;
    cursor: pointer;
    padding: 10px 15px;
}

button:hover {
    background-color: #004170;
}

/* kleine Lösch-Buttons */
.small-delete {
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1;
    border-radius: 4px;
    background: transparent;
    color: #b00;
    border: 1px solid transparent;
    cursor: pointer;
}
.small-delete:hover {
    background: rgba(176,0,0,0.08);
    border-color: rgba(176,0,0,0.15);
}

/* Tabellen: kleinere Zeilenhöhe bei Buttons */
.table-wrapper table td, .table-wrapper table th {
    padding: 6px 8px;
}

/* Team- / Helper-Pool auf Plan-Seite */
.plan-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px;
    align-items: start;
}
.left-panel {
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 6px;
    background: #fff;
    height: 75vh;
    overflow: auto;
}
.team-list-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.team-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.team-badge {
    display: inline-block;
    width: 34px;
    height: 20px;
    color: white;
    font-weight: bold;
    text-align: center;
    line-height: 20px;
    border-radius: 4px;
    font-size: 0.85rem;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}
.helper-pool {
    border-top: 1px solid #eee;
    margin-top: 8px;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.helper-item {
    padding: 6px 8px;
    border-radius: 6px;
    background: #f6f9ff;
    cursor: grab;
    user-select: none;
    border: 1px solid #e0e7ff;
}
.helper-item:active {
    cursor: grabbing;
}

/* Plan Grid Anpassungen */
#plan-container {
    position: relative;
    border: 1px solid #ccc;
    font-size: 12px;
}

#timeline-header {
    display: grid;
    background-color: #f2f2f2;
    border-bottom: 2px solid #ccc;
    padding-left: 200px;
    position: sticky;
    top: 0;
    z-index: 10;
}
#timeline-header .hour-slot {
    text-align: center;
    padding: 5px 0;
    border-right: 1px solid #ddd;
    font-size: 10px;
}
#timeline-header .day-header {
    text-align: center;
    font-weight: bold;
    padding: 5px;
    background-color: #e0e0e0;
    border-bottom: 1px solid #ccc;
}

#grid-container {
    max-height: 75vh;
    overflow: auto;
    position: relative;
}

.activity-group-header {
    font-weight: bold;
    background-color: #eaf2f8;
    padding: 10px 5px;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 9;
    width: 100%;
    border-bottom: 2px solid #ccc;
}

.activity-row {
    display: grid;
    border-bottom: 1px solid #eee;
}

.activity-name {
    padding: 8px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #fdfdfd;
    position: sticky;
    left: 0;
    width: 200px;
    border-right: 2px solid #ccc;
}

.shift-slot {
    border-right: 1px solid #eee;
    min-height: 30px;
    padding: 4px;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.shift-slot:hover {
    filter: brightness(0.98);
}

.shift-slot.filled {
    /* Schriftfarbe und Hintergrundfarbe von der Teamfarbe übernehmen */
    color: inherit;
    background-color: inherit;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    font-size: 11px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    padding: 20px 30px;
    border-radius: 8px;
    width: 400px;
}
.modal-content h2, .modal-content p {
    margin: 0 0 15px 0;
    color: #005A9F;
}
.modal-content p {
    color: #333;
}
#shift-form {
    display: flex;
    flex-direction: column;
}
#shift-form label {
    margin-top: 10px;
    font-weight: bold;
}
#shift-form select {
    margin-top: 5px;
    padding: 10px;
}
.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.modal-actions .danger {
    background-color: #d9534f;
}
.modal-actions .danger:hover {
    background-color: #c9302c;
}

.slot-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin: 12px 0 0;
    padding: 12px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    background: #fff;
}

.slot-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #233244;
}

.slot-legend-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid #7b8794;
    flex: 0 0 auto;
    position: relative;
}

.slot-legend-swatch.legend-filled {
    background: linear-gradient(135deg, #005A9F 0%, #53a2d9 100%);
    border-color: #005A9F;
}

.slot-legend-swatch.legend-open-all {
    background: #b9f6ca;
    border-color: #228b4e;
}

.slot-legend-swatch.legend-open-adult {
    background: #ffd59e;
    border-color: #b36200;
}

.slot-legend-swatch.legend-open-orga {
    background: #ffe46b;
    border-color: #9b7a00;
}

.slot-legend-swatch.legend-not-needed {
    background: #d6d9de;
    border-color: #8b949e;
}

.slot-legend-swatch.legend-not-needed::before {
    content: "✕";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c1121f;
    font-weight: 800;
    font-size: 16px;
    line-height: 1;
}

.shift-slot {
    border-right: 1px solid #d3d8df;
    border-bottom: 1px solid #edf1f4;
    position: relative;
}

.shift-slot:focus-visible {
    outline: 3px solid #005A9F;
    outline-offset: -3px;
    z-index: 2;
}

.shift-slot.slot-state-open-all {
    background: #b9f6ca;
    color: #10361c;
    border-color: #228b4e;
}

.shift-slot.slot-state-open-adult {
    background: #ffd59e;
    color: #5b3200;
    border-color: #b36200;
}

.shift-slot.slot-state-open-orga {
    background: #ffe46b;
    color: #4f3d00;
    border-color: #9b7a00;
}

.shift-slot.slot-state-not-needed {
    background: #d6d9de;
    color: #c1121f;
    border-color: #8b949e;
}

.shift-slot.slot-state-not-needed::before {
    content: "✕";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c1121f;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.shift-slot.filled {
    color: inherit;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    font-size: 11px;
    border-color: rgba(0, 0, 0, 0.2);
}

/* Navigation styles */
nav {
    background: #005A9F;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}
nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s;
}
nav a:hover {
    background: rgba(255,255,255,0.1);
}
nav a.active {
    background: rgba(255,255,255,0.2);
    font-weight: 600;
}

/* Burger menu button – hidden on wide screens */
.nav-burger {
    display: none;
    background: transparent;
    border: 2px solid rgba(255,255,255,0.7);
    color: white;
    font-size: 20px;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-burger:hover {
    background: rgba(255,255,255,0.15);
}

/* Nav links wrapper */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    flex: 1;
}

/* Responsive: show burger, collapse links */
@media (max-width: 768px) {
    nav {
        flex-wrap: nowrap;
        padding: 10px 14px;
    }
    .nav-burger {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        flex: none;
        order: 99;
        gap: 4px;
        padding-top: 8px;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links a {
        padding: 10px 12px;
    }
}
