/* Grundlayout für den Kalender-Container
#############################################*/
#bc-calendar {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#bc-calendar table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Zellen: Rahmen, Innenabstand, Ausrichtung */
#bc-calendar th,
#bc-calendar td {
    border: 1px solid #e5e7eb;
    padding: 0.4rem 0.5rem;
    vertical-align: top;
}

#bc-calendar th {
    background: #f3f4f6;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

#bc-calendar td {
    min-height: 64px;
    height: 64px;
}

/* Tageszahl */
#bc-calendar .bc-day-number {
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

/* Hervorhebungen */
#bc-calendar td.bc-day-today {
    background: #ecfdf5;
}

#bc-calendar td.bc-day-today .bc-day-number {
    color: #059669;
    font-weight: 700;
}

#bc-calendar td.bc-day-past {
    background: #f9fafb;
}

#bc-calendar td.bc-day-past .bc-day-number {
    color: #9ca3af;
}

#bc-calendar td.bc-day-vacation {
    background: #fffbeb;
}

#bc-calendar td.bc-day-blocked {
    background: #ffffff;
}

#bc-calendar td.bc-day-vacation .bc-day-number {
    color: #d97706;
}

#bc-calendar .bc-vacation-label {
    font-size: 0.6rem;
    color: #d97706;
    line-height: 1.3;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

#bc-calendar td.bc-day-holiday {
    background: #fff1f2;
}

#bc-calendar td.bc-day-holiday .bc-day-number {
    color: #dc2626;
    font-weight: 700;
}

#bc-calendar .bc-holiday-name {
    font-size: 0.6rem;
    color: #dc2626;
    line-height: 1.3;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Sonntage: Tageszahl rot (traditionell), kein Hintergrund */
#bc-calendar td.bc-day-sunday:not(.bc-day-holiday) .bc-day-number {
    color: #dc2626;
}

/* INHALT DES KALENDERS
#############################################*/

/* Standard-Layout für die Pills (Desktop ok lassen) */
#bc-calendar .bc-slot-pill {
    /* dein Inline-Style bleibt, wir ergänzen/verfeinern nur */
    display: inline-block;
}

/* Desktop/Standard: Pill + +N nebeneinander */
#bc-calendar .bc-slot-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

/* Kompaktes Total-Badge für Mobile – standardmäßig ausgeblendet */
#bc-calendar .bc-slot-row-compact {
    display: none;
}

/* Buttons selbst – du hast schon Inline-Styles, das hier ergänzt nur Verhalten */
#bc-calendar .bc-slot-pill {
    white-space: nowrap;
}

/* SCHRIFTEN UND TITEL
#############################################*/

/* Kopfzeile des Kalenders */
#bc-calendar .bc-calendar-header {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;  
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Gemeinsame Typo für alle drei (prev, aktueller Titel, next) */
#bc-calendar .bc-calendar-header .bc-month-prev,
#bc-calendar .bc-calendar-header .bc-calendar-title,
#bc-calendar .bc-calendar-header .bc-month-next {
    font-size: clamp(0.9rem, 4vw, 1.4rem);
    font-weight: 400;
    white-space: nowrap;
    line-height: 1.2;
    margin: 0;
}

/* AKTIVE Monate (Prev & Next): grün, klickbar */
#bc-calendar .bc-month-nav:not(.bc-month-disabled),
#bc-calendar .bc-month-nav:not(.bc-month-disabled):link,
#bc-calendar .bc-month-nav:not(.bc-month-disabled):visited {
    color: #166534;
    text-decoration: underline;
}

#bc-calendar .bc-month-nav:not(.bc-month-disabled):hover,
#bc-calendar .bc-month-nav:not(.bc-month-disabled):active {
    color: #14532d;
}

/* DEAKTIVIERTE Monate (kein Wechsel mehr möglich): grau, nicht klickbar */
#bc-calendar .bc-month-disabled {
    color: #9ca3af;
    text-decoration: none;
    cursor: default;
}


/* MEDIA QUERIES
#############################################*/
/* Mobile / schmalere Breiten: innerhalb der Zelle umbrechen statt rauszulaufen */
@media (max-width: 992px) {
    #bc-calendar .bc-slot-row {
        flex-wrap: wrap;          /* erlaubt Umbruch innerhalb der Zelle */
    }

    #bc-calendar .bc-slot-pill {
        flex: 1 1 100%;           /* Pill oben, volle Breite */
        text-align: center;
    }

    #bc-calendar .bc-more-badge {
        flex: 0 0 auto;           /* +N bleibt daneben/unterhalb, aber in der Zelle */
        margin-top: 4px;
    }
}

/* HEUTE-Link (rechts in der Header-Zeile)
#############################################*/
#bc-calendar .bc-heute-link {
    margin-left: auto;
    align-self: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #16a34a;
    text-decoration: none !important;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    padding: 0.15rem 0.6rem;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

#bc-calendar .bc-heute-link:hover {
    background: #f0fdf4;
    border-color: #16a34a;
}

#bc-calendar .bc-heute-disabled {
    color: #d1d5db !important;
    border-color: #f3f4f6 !important;
    cursor: default;
}

/* Portrait-Smartphone/Tablet: kein horizontales Scrollen
#############################################*/
@media (max-width: 749px) {
    /* Tabelle passt sich dem Viewport an */
    #bc-calendar table {
        min-width: 0;
    }

    /* Minimales Padding – jedes Pixel zählt */
    #bc-calendar th,
    #bc-calendar td {
        padding: 2px 1px;
    }

    #bc-calendar th {
        font-size: 0.7rem;
    }

    /* Feiertags- und Urlaubsbezeichnungen ausblenden –
       Hintergrundfarbe bleibt als visueller Hinweis */
    #bc-calendar .bc-holiday-name,
    #bc-calendar .bc-vacation-label {
        display: none;
    }

    /* Desktop-Slot-Reihe (Zeitpill + +N) verstecken */
    #bc-calendar .bc-slot-row {
        display: none;
    }

    /* Kompaktes Total-Badge einblenden */
    #bc-calendar .bc-slot-row-compact {
        display: flex;
        justify-content: center;
        margin-top: 3px;
    }
}

/* Mobile-Optimierung */
@media (max-width: 768px) {
    #bc-calendar th,
    #bc-calendar td {
        padding: 0.25rem;
        font-size: 0.8rem;
    }

    /* Wochentags-Köpfe etwas kleiner */
    #bc-calendar th {
        font-weight: 500;
    }

    /* Datum in der Ecke minimal kleiner */
    #bc-calendar td > div:first-child {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }

    #bc-calendar .bc-slot-pill {
        display: block;
        width: 100%;
        text-align: center;
        padding: 6px 10px;        /* etwas mehr „Fingerfläche“ */
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    #bc-calendar .bc-more-badge {
        transform: scale(0.9);    /* etwas kleiner, damit sie nicht dominiert */
    }

    /* Container, in dem die beiden Buttons sitzen, etwas „stacken“ */
    #bc-calendar td > div[style*="display:flex"] {
        flex-wrap: wrap;
        gap: 4px;
    }
}
