/* ============================================================
   Belegungsplaner – Zeitraster-Kalender
   ============================================================ */

/* ── Basis ────────────────────────────────────────────────── */
.bp-wrap * {
    box-sizing: border-box;
}

.bp-wrap {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    color: #1e293b;
    max-width: 1200px;
    margin: 0 auto;
}

.bp-inner {
    transition: opacity .2s;
}

/* ── Header ───────────────────────────────────────────────── */
.bp-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
}

.bp-titel {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    flex: 1 1 auto;
}

.bp-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 10px;
}

.bp-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    line-height: 1;
    font-family: inherit;
    font-size: 1.3rem;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.bp-nav-btn:hover {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}

.bp-woche-label {
    font-weight: 600;
    font-size: 0.92rem;
    color: #334155;
    min-width: 155px;
    text-align: center;
}

.bp-heute-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 14px;
    font-size: 0.80rem;
    font-family: inherit;
    font-weight: 600;
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
}

.bp-heute-btn:hover {
    background: #bfdbfe;
}

/* ── Scroll-Container (Mobile) ────────────────────────────── */
.bp-kalender-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

/* ── Grid-Struktur ────────────────────────────────────────── */
.bp-kalender-grid {
    min-width: 600px;
    display: flex;
    flex-direction: column;
}

/* Spalten-Header-Zeile */
.bp-col-header-row {
    display: grid;
    grid-template-columns: 52px repeat(7, 1fr);
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
}

.bp-col-header {
    padding: 8px 4px;
    text-align: center;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
}

.bp-col-header:last-child {
    border-right: none;
}

.bp-col-header--heute {
    background: #1d4ed8;
}

.bp-col-header--heute .bp-col-wt,
.bp-col-header--heute .bp-col-datum {
    color: #fff !important;
}

.bp-time-gutter-header {
    background: #f8fafc;
}

.bp-col-wt {
    display: block;
    font-weight: 700;
    font-size: 0.80rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.bp-col-datum {
    display: block;
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* Body-Zeile: Stundenspalte + Tage */
.bp-body-row {
    display: grid;
    grid-template-columns: 52px repeat(7, 1fr);
}

/* ── Stundenspalte ────────────────────────────────────────── */
.bp-time-gutter {
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

.bp-time-slot {
    position: relative;
    border-bottom: 1px solid #e2e8f0;
}

.bp-time-label {
    position: absolute;
    top: -8px;
    right: 6px;
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1;
}

/* ── Tag-Spalten ──────────────────────────────────────────── */
.bp-day-col {
    position: relative;
    border-right: 1px solid #e2e8f0;
    background: #fff;
}

.bp-day-col:last-child {
    border-right: none;
}

.bp-day-col--heute {
    background: #f0f6ff;
}

/* Rasterlinien */
.bp-grid-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #f1f5f9;
    pointer-events: none;
}

/* Halbstunden-Linien (werden per CSS :nth generiert – alternativ via JS) */
.bp-grid-line--half {
    background: #f8fafc;
}

/* ── Termin-Block ─────────────────────────────────────────── */
.bp-termin {
    position: absolute;
    /* left/width werden per PHP inline-style gesetzt (Kollisionslayout) */
    box-sizing: border-box;
    padding-right: 2px; /* kleiner Gap zwischen Spalten */
    background: var(--bp-color-light, rgba(59,130,246,.15));
    border-left: 3px solid var(--bp-color, #3b82f6);
    border-radius: 0 4px 4px 0;
    overflow: hidden;
    cursor: default;
    transition: filter .15s, box-shadow .15s;
    z-index: 2;
}

.bp-termin:hover {
    filter: brightness(.95);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    z-index: 5;
}

.bp-termin-inner {
    padding: 3px 5px;
    height: 100%;
    overflow: hidden;
}

.bp-termin-sport {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--bp-color, #1e293b);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bp-termin-zeit {
    font-size: 0.70rem;
    color: #475569;
    margin-top: -1px;
    white-space: nowrap;
    overflow: hidden;
}

.bp-termin-hinweis {
    font-size: 0.68rem;
    color: #94a3b8;
    font-style: italic;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Footer ───────────────────────────────────────────────── */
.bp-footer-note {
    margin-top: 10px;
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
}

.bp-footer-note p {
    margin: 0;
}


/* ── Hover-Tooltip (JS-positioniert, fixed) ──────────────── */
#bp-tooltip {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 8px;
    padding: 10px 13px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    font-size: 0.78rem;
    line-height: 1.5;
    max-width: 260px;
    min-width: 160px;
    white-space: normal;
    word-break: break-word;
    opacity: 0;
    transition: opacity .15s;
}

#bp-tooltip.bp-tooltip--visible {
    opacity: 1;
}

/* Pfeil (dynamisch oben/unten per JS-Klasse) */
#bp-tooltip::before {
    content: '';
    position: absolute;
    border: 6px solid transparent;
}

#bp-tooltip.bp-tooltip--left::before {
    right: 100%;
    top: 12px;
    border-right-color: #1e293b;
}

#bp-tooltip.bp-tooltip--right::before {
    left: 100%;
    top: 12px;
    border-left-color: #1e293b;
}

.bp-tooltip-name {
    display: block;
    font-weight: 700;
    font-size: 0.82rem;
    color: #fff;
    margin-bottom: 2px;
}

.bp-tooltip-zeit {
    display: block;
    font-size: 0.73rem;
    color: #94a3b8;
    margin-bottom: 6px;
}

.bp-tooltip-notiz {
    border-top: 1px solid #334155;
    padding-top: 6px;
    color: #cbd5e1;
}
