/* ==========================================================================
   1. GEMEINSAME BASIS-STYLES & TYPOGRAPHY (MUI LOOK)
   ========================================================================== */
.tvr-responsive-calendar-container {
    width: 100%;
    font-family: "Roboto", "Helvetica", "Arial", sans-serif;
    box-sizing: border-box;
}

/* ==========================================================================
   2. STANDARD-ZUSTAND: MOBILE / KLEINE SCREENS (ZEIGE NUR LISTE)
   ========================================================================== */
.tvr-desktop-only {
    display: none !important;
}

.tvr-mobile-only {
    display: block !important;
}

/* ==========================================================================
   3. DESKTOP-ZUSTAND: AB 920px BREITE (SCHALTE UM AUF GRID)
   ========================================================================== */
/* ==========================================================================
   3. DESKTOP-ZUSTAND: AB 920px BREITE (SCHALTE UM AUF GRID)
   ========================================================================== */
@media screen and (min-width: 920px) {
    
    .tvr-mobile-only {
        display: none !important;
    }

    .tvr-desktop-only {
        display: block !important;
    }

    /* Äußere Card drumherum (MUI Paper) */
    .tvr-calendar-main-card {
        width: 100% !important;
        max-width: 100% !important;
        border: 1px solid rgba(0, 0, 0, 0.12) !important;
        border-radius: 4px !important;
        overflow: hidden !important;
        background-color: rgba(0, 0, 0, 0.12) !important; /* Erzeugt die Grid-Linien */
        box-sizing: border-box !important;
    }

    /* 💡 ABSICHERUNG: Beide Grids erhalten mathematisch exakt dieselbe Spaltenbreite 
       und werden gegen Theme-Paddings immunisiert */
    .tvr-calendar-header-grid,
    .tvr-calendar-grid {
        display: grid !important;
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        gap: 1px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Wochentage Header */
    .tvr-calendar-header-cell {
        background-color: #f5f5f5 !important;
        padding: 12px 4px !important;
        text-align: center !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
        box-sizing: border-box !important;
    }

    .tvr-calendar-header-text {
        font-size: 0.875rem !important;
        font-weight: 800 !important;
        color: rgba(0, 0, 0, 0.6) !important;
    }

    /* Einzelne Tag-Zelle */
    .tvr-calendar-day-cell {
        background-color: #ffffff !important;
        min-height: 140px !important;
        padding: 8px !important;
        display: flex !important;
        flex-direction: column !important;
        transition: background-color 0.2s ease !important;
        box-sizing: border-box !important;
    }

    .tvr-calendar-day-cell:hover {
        background-color: rgba(25, 118, 210, 0.02) !important;
    }

    /* Tage außerhalb des aktuellen Monats */
    .tvr-calendar-day-cell.tvr-not-current-month {
        background-color: rgba(245, 245, 245, 0.6) !important;
    }

    /* Datumsnummer-Container */
    .tvr-day-number-container {
        display: flex !important;
        justify-content: flex-start !important;
        margin-bottom: 8px !important;
    }

    .tvr-day-number {
        font-size: 0.75rem !important;
        font-weight: 500 !important;
        color: rgba(0, 0, 0, 0.87) !important;
        display: inline-block !important;
        width: 24px !important;
        height: 24px !important;
        line-height: 24px !important;
        text-align: center !important;
        border-radius: 4px !important;
    }

    .tvr-not-current-month .tvr-day-number {
        color: rgba(0, 0, 0, 0.38) !important;
    }

    .tvr-badge-today {
        font-weight: 900 !important;
        color: #ffffff !important;
        background-color: #1976d2 !important;
    }

    /* Termin-Stack */
    .tvr-calendar-session-stack {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        flex-grow: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* --- Die einzelnen Session-Karten (MUI Paper Look) --- */
/* --- Die einzelnen Session-Karten (MUI Paper Look) --- */
    .tvr-calendar-session-card {
        font-size: 0.75rem !important;
        padding: 6px !important;
        border-radius: 4px !important;
        cursor: pointer !important;
        background-color: #ffffff !important;
        
        /* 🛠️ FIX: Rahmen separat definieren, damit border-left aus dem PHP-Inline-Style Priorität behält */
        border-top: 1px solid rgba(0, 0, 0, 0.12) !important;
        border-right: 1px solid rgba(0, 0, 0, 0.12) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
        /* Kein border-left hier deklarieren, da PHP das steuert! */
        
        box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.08) !important;
        transition: all 0.15s ease !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
        position: relative !important;
    }

    .tvr-calendar-session-card:hover {
        background-color: rgba(0, 0, 0, 0.04) !important;
        box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.12) !important;
        transform: translateY(-1px) !important;
    }

    .tvr-session-cancelled {
        opacity: 0.6 !important;
    }

    .tvr-session-title {
        font-weight: 800 !important;
        color: #2c3e50 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .tvr-session-meta {
        font-size: 0.7rem !important;
        opacity: 0.8 !important;
        color: rgba(0, 0, 0, 0.6) !important;
        margin-top: 2px !important;
    }

    .tvr-session-facility {
        font-size: 0.65rem !important;
        opacity: 0.7 !important;
        color: rgba(0, 0, 0, 0.6) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin-top: 2px !important;
    }
}

/* ==========================================================================
   4. PROTECTION GEGEN WORDPRESS AUTO-P INJEKTIONEN
   ========================================================================== */
.tvr-calendar-grid > p, .tvr-calendar-grid > br,
.tvr-calendar-header-grid > p, .tvr-calendar-header-grid > br {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}