/* ================================================================
   Thekenplan
   ================================================================ */

.wp-spon-thekenplan-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 90vh;
}

.wp-spon-thekenplan {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
    font-family: Arial, sans-serif;
}

.wp-spon-thekenplan td {
    border: 1px solid #D0D0D0;
    text-align: center;
    padding: 2px 3px;
    white-space: nowrap;
}

/* Sticky Header-Zeilen */
.tp-fixed-row td {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #2c3e50;
    color: #ecf0f1;
}
.tp-fixed-row.tp-header-mins td {
    top: 22px; /* wird per JS angepasst */
}

/* Stunden-Header */
.tp-hour {
    background: #2c3e50 !important;
    color: #ecf0f1 !important;
    border: 1px solid #3d5166 !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-size: 11px;
}
/* Icon-Zellen in Stunden-Zeile */
.tp-header-hours .tp-icon-col {
    background: #2c3e50 !important;
    border: 1px solid #3d5166 !important;
    color: #7fb3d3 !important;
}
/* Minuten-Zeile etwas heller für Tiefe */
.tp-min {
    background: #34495e !important;
    color: #bdc3c7 !important;
    border: 1px solid #3d5166 !important;
    font-size: 9px;
    font-weight: normal;
}
.tp-header-mins .tp-icon-col {
    background: #34495e !important;
    border: 1px solid #3d5166 !important;
}
.tp-min-start { border-left: 2px solid #5d7d94 !important; }
.tp-min-end   { border-right: 2px solid #5d7d94 !important; }

/* Spalten-Breiten */
.tp-label-col  { width: 100px; min-width: 80px; }
.tp-icon-col   { width: 22px; min-width: 22px; }
.tp-header-transparent { background: transparent !important; border: none !important; }

/* Spacer */
.tp-spacer {
    height: 8px;
    background: #f5f5f5;
    border: none !important;
}

/* Tag-Label */
.tp-day-label {
    background: #92D050 !important;
    font-weight: bold;
    text-align: left;
    padding: 4px 6px !important;
    border: 1px solid #76933C !important;
}

/* Personen-Label */
.tp-person-label {
    text-align: left;
    padding: 2px 6px !important;
    background: #fff;
}
.tp-person-label.tp-nicht-da {
    font-style: italic;
    color: #888;
}

/* Leere Zelle */
.tp-cell-empty { background: #fff; }

/* Team-Block (farbig, colspan) */
.tp-team-block {
    font-weight: bold;
    font-size: 11px;
    border: 1px solid rgba(0,0,0,0.2) !important;
    overflow: hidden;
}

/* Personen-Block (grün/grau) */
.tp-person-block {
    border: 1px solid rgba(0,0,0,0.15) !important;
}

/* Aktions-Icons */
.tp-action {
    cursor: pointer;
    font-size: 13px;
    margin-right: 3px;
    opacity: 0.6;
}
.tp-action:hover { opacity: 1; }

/* Neuer Eintrag */
.tp-new-entry {
    cursor: pointer;
    color: #0073aa;
    font-size: 11px;
    padding: 2px 6px;
    display: inline-block;
}
.tp-new-entry:hover { text-decoration: underline; }
.tp-new-entry-cell { text-align: left; border: none !important; }

/* Icon-Spalte */
.tp-icon-col { background: #fff; font-size: 13px; }

/* ================================================================
   Modal / Popup
   ================================================================ */
.tp-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}
.tp-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    min-width: 360px;
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}
.tp-modal-header {
    background: #2271b1;
    color: #fff;
    padding: 12px 16px;
    font-weight: bold;
    font-size: 14px;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tp-modal-close {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.8;
}
.tp-modal-close:hover { opacity: 1; }
.tp-modal-body {
    padding: 16px;
}
.tp-modal-footer {
    padding: 10px 16px;
    text-align: right;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
}
.tp-modal-footer .button { margin-left: 8px; }

.tp-form-table { width: 100%; border-collapse: collapse; }
.tp-form-table tr td { padding: 5px 4px; vertical-align: top; }
.tp-form-table tr td:first-child { width: 130px; font-weight: bold; font-size: 12px; }
.tp-form-table select,
.tp-form-table input[type="text"] {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
}
.tp-form-group-sep { height: 10px; }
.tp-form-error { color: #a00; font-size: 12px; margin-top: 6px; }

/* Neuer Tag: Mannschafts-Block */
.tp-slot-block {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 6px;
    margin-bottom: 8px;
}
.tp-slot-block legend {
    font-size: 11px;
    color: #555;
    font-weight: bold;
}

/* ================================================================
   Responsive: Mobile-Ansicht
   ================================================================ */

/* Desktop: Grid sichtbar, Karten versteckt */
.tp-mobile-view { display: none; }

/* Tablet/Mobile (≤ 860px): Karten sichtbar, Grid versteckt */
@media (max-width: 860px) {

    .wp-spon-thekenplan-wrapper { display: none; }
    .tp-mobile-view { display: block; }

    /* Karten-Container */
    .tp-mobile-card {
        border: 1px solid #d0d0d0;
        border-radius: 6px;
        margin-bottom: 14px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }

    /* Tages-Header */
    .tp-mobile-header {
        background: #92D050;
        padding: 8px 10px;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        border-bottom: 1px solid #76933C;
    }
    .tp-mobile-date {
        font-weight: bold;
        font-size: 14px;
        color: #2d3a1a;
        flex: 1;
    }
    .tp-mobile-va {
        font-size: 12px;
        color: #3d5020;
        font-style: italic;
    }
    .tp-mobile-actions {
        margin-left: auto;
        display: flex;
        gap: 6px;
    }
    .tp-mobile-actions .tp-action {
        font-size: 16px;
    }

    /* Mannschafts-Pills */
    .tp-mobile-teams {
        padding: 8px 10px 4px;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        border-bottom: 1px solid #eee;
    }
    .tp-mobile-pill {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 4px 9px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        border: 1px solid rgba(0,0,0,0.12);
    }
    .tp-mobile-pill-time {
        font-weight: normal;
        font-size: 11px;
        opacity: 0.85;
    }

    /* Personen-Liste */
    .tp-mobile-persons {
        padding: 6px 10px;
    }
    .tp-mobile-person {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 5px 0;
        border-bottom: 1px solid #f0f0f0;
        flex-wrap: wrap;
        font-size: 13px;
    }
    .tp-mobile-person:last-child { border-bottom: none; }
    .tp-mobile-nicht-da .tp-mobile-pname {
        font-style: italic;
        color: #999;
        text-decoration: line-through;
    }
    .tp-mobile-pname {
        min-width: 90px;
        font-weight: 500;
    }
    .tp-mobile-slots {
        display: flex;
        gap: 4px;
        flex-wrap: wrap;
        flex: 1;
    }
    .tp-mobile-slot-chip {
        display: inline-block;
        padding: 2px 7px;
        border-radius: 10px;
        font-size: 11px;
        font-weight: 500;
        border: 1px solid rgba(0,0,0,0.1);
        white-space: nowrap;
    }
    .tp-mobile-picons {
        font-size: 14px;
        white-space: nowrap;
    }
    .tp-mobile-edit-actions {
        display: flex;
        gap: 4px;
    }
    .tp-mobile-edit-actions .tp-action {
        font-size: 14px;
        opacity: 0.5;
    }

    /* Neuer Eintrag */
    .tp-mobile-new-entry {
        padding: 6px 10px;
        border-top: 1px solid #eee;
    }

    /* Farb-Legende kompakter */
    .tp-legend-item { font-size: 10px; }
    .tp-legend-dot  { width: 11px; height: 11px; }
}

/* Extra-klein (≤ 480px): noch kompakter */
@media (max-width: 480px) {
    .tp-mobile-date  { font-size: 13px; }
    .tp-mobile-pname { min-width: 70px; font-size: 12px; }
    .tp-mobile-slot-chip { font-size: 10px; padding: 2px 5px; }
    .tp-mobile-pill  { font-size: 11px; padding: 3px 7px; }
}

/* ================================================================
   Farb-Legende */
.tp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}
.tp-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}
.tp-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.15);
}
