/* MH Timetable - Professional Dark Blue Design */

.timetable-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #ccc;
    background: #fff;
}

.timetablegrid {
    border-collapse: collapse;
    table-layout: fixed;
    width:  max-content; /* Geändert von auto auf max-content */;
}

/* --- Spalten-Dimensionen --- */
.timetablegrid th:not(.sticky_column), 
.timetablegrid td:not(.sticky_column) {
    width: 30px; /* Minimal breiter für größere Schrift */
    min-width: 30px;
    max-width: 30px;
}

.timetablegrid td {
    height: 45px; /* Etwas mehr Luft in der Zeilenhöhe */
}

/* --- Header mit neuem Blau --- */
.timetablegrid_thead th {
    background-color: #002a55;
    color: white;
    height: 110px;
    padding: 0;
    vertical-align: middle;
    border: 1px solid #001a35;
     padding: 0 !important;
    margin: 0 !important;
    line-height: 0; /* Verhindert Phantom-Abstände unter dem Text */
}

.timetablegrid_thead th.timetable_date_weekend {
    background-color: #001a35; /* Ein deutlich dunkleres Blau für Sa/So */
    border-left: 1px solid #002a55;
}
/* Optional: Den Text im Wochenend-Header etwas blasser machen */
.timetable_date_weekend .vertical-header-wrapper {
    color: #b0c4de; /* LightSteelBlue */
}
/* Der Dreh-Wrapper mit größerer Schrift */
.vertical-header-wrapper {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    font-size: 13px; /* Größere, gut lesbare Schrift */
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.date-part { 
    font-weight: bold; 
    margin-bottom: 5px; 
}

.day-part { 
    opacity: 0.9;
    font-weight: normal;
}

/* --- Erste Spalte (Sticky) --- */
.timetablegrid .sticky_column {
     position: sticky;
    left: 0;
    width: 140px; /* Etwas schmaler */
    background: #fcfcfc;
    z-index: 100;
    text-align: left;
    padding: 0 8px !important; /* Weniger Polsterung */
    border-right: 2px solid #002a55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timetablegrid_thead th.sticky_column {
    background-color: #002a55;
    color: white;
    font-size: 14px;
    font-weight: bold;
     z-index: 150; /* Höher als die 100 der normalen sticky_column */
}

/* --- Termin-Balken --- */
[class^="td_"] {
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 4px !important;
    border-radius: 3px;
    line-height: 1.2;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.1);
}

/* Spezialtage */
.weekend { background-color: #f5f5f5; }
.holiday { background-color: #fff9c4; }
.today { background-color: #eef7ff; outline: 1px solid #002a55; outline-offset: -1px; }




/* Switcher Styles */
.tt-view-switcher {
    display: flex;
    gap: 5px;
}
.tt-switch-btn { 
    padding: 8px 15px; border: 1px solid #002a55; background: #fff; color: #002a55; 
    cursor: pointer; border-radius: 4px; display: flex; align-items: center; gap: 5px;
}
.tt-switch-btn.active { background: #002a55; color: #fff; }

/* List View / Card Styles */
.tt-list-view { max-width: 800px; margin: 0 auto; }
.tt-list-date-divider { 
    margin: 30px 0 15px; border-bottom: 2px solid #eee; position: relative; 
}
.tt-list-date-divider span { 
    background: #fff; padding-right: 15px; position: relative; top: 10px; 
    font-weight: bold; color: #002a55; text-transform: uppercase; font-size: 12px;
}

.tt-list-card { 
    background: #fff; border: 1px solid #e0e0e0; border-radius: 5px; 
    margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: transform 0.2s;
}
.tt-list-card:hover { transform: translateX(5px); }
.tt-list-card-content { padding: 15px; }

.tt-list-card-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.tt-list-bg { font-weight: bold; color: #555; }
.tt-list-type { 
    font-size: 10px; padding: 2px 8px; border-radius: 10px; color: #fff; text-transform: uppercase; 
}
.tt-list-title { margin: 5px 0; font-size: 16px; color: #002a55; }
.tt-list-meta { font-size: 12px; color: #888; display: flex; align-items: center; gap: 5px; }


.tt-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tt-filter-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tt-bg-filter {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 200px;
}

/* Der Name des Bildungsgangs */
.timetablegrid .bg-name {
    display: inline-block;
    font-weight: 600;
    font-size: 12px !important; /* Deutlich kleiner */
    color: #333;
    line-height: 1;
    vertical-align: middle;
}

/* Der iCal Link daneben */
.timetablegrid .ical-small-link {
    display: inline-block;
    font-size: 10px !important; /* Ganz dezent */
    color: #2271b1;
    text-decoration: none;
    margin-left: 2px;
    vertical-align: middle;
    opacity: 0.7;
}

.timetablegrid .ical-small-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.mh-tt-frontend-wrapper {
    margin-bottom: 50px;
    clear: both;
}

.tt-switch-btn .dashicons, 
.tt-list-meta .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    vertical-align: middle;
    margin-top: -3px; /* Feinjustierung */
}


/* Month View Grid */
.tt-month-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 40px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.tt-month-title {
    color: #002a55;
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
}

.tt-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #eee;
    border: 1px solid #eee;
}

.tt-month-day-header {
    background: #002a55;
    color: #fff;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
}

.tt-month-day {
    background: #fff;
    min-height: 100px;
    padding: 5px;
    position: relative;
}

.tt-month-day.is-weekend { background: #f9f9f9; }
.tt-month-day.is-holiday { background: #fffde7; }
.tt-month-day.is-today { background: #eef7ff; box-shadow: inset 0 0 0 2px #002a55; }

.day-number {
    font-size: 12px;
    font-weight: bold;
    color: #999;
    display: block;
    margin-bottom: 5px;
}

.is-today .day-number { color: #002a55; }

/* --- Month View Grid Fix --- */
.tt-month-view-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden; /* Verhindert horizontalen Scrollbar des Grids */
}

.tt-month-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 40px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
}

.tt-month-grid {
    display: grid;
    /* DIESE ZEILE IST DER FIX: minmax(0, ...) zwingt die Spalten zur Kooperation */
    grid-template-columns: repeat(7, minmax(0, 1fr)); 
    width: 100%;
    background: #eee;
    border: 1px solid #eee;
    gap: 1px;
}

.tt-month-day {
    background: #fff;
    min-height: 110px; /* Feste Mindesthöhe */
    padding: 5px;
    overflow: hidden; /* Wichtig! */
    display: flex;
    flex-direction: column;
}

/* --- Event Bars Fix --- */
.day-event-bar {
    height: 20px;
    min-height: 20px;
    border-radius: 3px;
    font-size: 10px;
    color: #fff;
    padding: 0 6px;
    margin-bottom: 2px;
    display: block; /* Block statt Flex für besseres Ellipsis-Handling */
    white-space: nowrap; /* Kein Zeilenumbruch */
    overflow: hidden; /* Text abschneiden */
    text-overflow: ellipsis; /* Die drei Punkte ... anzeigen */
    line-height: 20px;
    width: 100%;
    box-sizing: border-box;
}

.event-content {
    display: inline; /* Textfluss beibehalten */
}

.event-subtext {
    font-style: italic;
    opacity: 0.8;
    font-size: 0.9em;
    margin-left: 3px;
}

/* Hover-Effekt: Nur wenn man wirklich Details braucht */
.day-event-bar:hover {
    position: relative;
    z-index: 999;
    width: auto;
    min-width: 100%;
    background-color: inherit; /* Behält die Farbe bei */
    overflow: visible;
    white-space: normal; /* Text im Hover ausklappen */
    height: auto;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

/* Hilfsklasse für den Filter */
.tt-hidden {
    display: none !important;
}