/* komponenten/Buchungskalender/assets/css/kalender.css */

/* FIX: 'separate' verhindert, dass Chrome/Safari das "sticky" beim Scrollen zerschießt */
.calendar-table { border-collapse: separate; border-spacing: 0; table-layout: auto; margin: 0 auto; border-left: 1px solid #e2e8f0; border-top: 1px solid #e2e8f0; }

.calendar-table th, .calendar-table td { border: none; border-right: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; text-align: center; position: relative; box-sizing: border-box; }

/* DESKTOP: Exakt 40x40 Quadrate (nur für die Daten-Zellen!) */
.calendar-table tbody tr { height: 40px; }
.calendar-table td.day-cell { height: 40px; width: 40px; min-width: 40px; max-width: 40px; padding: 0; overflow: hidden; }

/* NEU: Kopfzeile (Tage) mit reduziertem, optisch zentriertem Abstand */
.calendar-table th.day-header { 
    height: auto; 
    width: 40px; min-width: 40px; max-width: 40px; 
    /* Oben weniger Abstand als unten, um die Schrift-Baseline auszugleichen. Insgesamt weniger Platz. */
    padding: 0.3rem 0 0.4rem 0; 
    font-size: 0.7rem; font-weight: normal; background-color: #f9fafb; vertical-align: middle; 
    line-height: 1.2;
}
/* Entfernt die unsichtbare Höhe der Zahl, damit sie zentriert wirkt */
.calendar-table th.day-header .text-base { 
    font-size: 0.9rem !important; 
    line-height: 1 !important; 
    display: block; 
    margin-top: 3px; 
}

/* Erste Spalte festpinnen (Sticky) */
.calendar-table .wohnung-name-cell { white-space: nowrap; font-weight: bold; font-size: 0.8rem; background-color: #f9fafb; padding: 0 0.5rem; text-align: left; vertical-align: middle; position: sticky; left: 0; z-index: 40; box-shadow: 2px 0 5px -2px rgba(0,0,0,0.1); }
.calendar-table thead tr th.wohnung-name-cell { z-index: 50; } 
.calendar-table thead tr th:first-child { border-top-left-radius: 8px; background-color: #f9fafb; }

.today { background-color: #8ff0a4 !important; }
.weekend { background-color: #fafafa; }
.day-cell-free { cursor: pointer; }
.day-cell-free:hover { background-color: #f0f9ff; }

/* Segmente */
.segment { position: absolute; top: 5px; bottom: 5px; display: block; transition: all 0.15s ease-in-out; }
.segment-clickable { cursor: pointer; }

/* Gruppen-Hover (JS gesteuert) */
.segment-hover-active { filter: brightness(1.1); transform: scaleY(1.1); z-index: 30 !important; }

.segment-shape-start { border-radius: 8px 0 0 8px; left: 50%; width: 50%; }
.segment-shape-mid { left: -1px; width: calc(100% + 2px); z-index: 5; }
.segment-shape-end { border-radius: 0 8px 8px 0; width: 50%; left: 0; }
.segment-shape-single { border-radius: 8px; left: 5px; width: calc(100% - 10px); }
.segment-shape-wechsel-anreise { border-radius: 8px 0 0 8px; left: 56%; width: 44%; }
.segment-shape-wechsel-abreise { border-radius: 0 8px 8px 0; width: 44%; left: 0; }

.segment-modifier-booking { background-color: #3B82F6; }
.segment-shape-single.segment-modifier-booking { background-color: #6366F1; }

/* NEU: Auffälliges Styling für unverbindliche Reservierungsanfragen (Schraffiert) */
.segment-modifier-reservation { 
    background-color: #f97316; /* Tailwind orange-500 */
    background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,0.3) 5px, rgba(255,255,255,0.3) 10px);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

@keyframes pulse-border { 0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); } 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); } }
.segment-modifier-status-1 { background: #9b59b6 !important; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #9b59b6; z-index: 10; }
.segment-modifier-status-2 { background-color: #ff7800 !important; box-shadow: 0 0 0 rgba(249, 115, 22, 0.7); animation: pulse-border 2s infinite; z-index: 9; }
.segment-modifier-status-3 { background-color: #f6d32d !important; box-shadow: 0 0 0 rgba(246, 211, 45, 0.7); animation: pulse-border 2s infinite; z-index: 8; }

@media (max-width: 767px) {
    /* MOBILE: Exakt 26x26 Quadrate für Datenzellen */
    .calendar-table tbody tr { height: 26px !important; }
    .calendar-table td.day-cell { 
        width: 26px !important; 
        min-width: 26px !important; 
        max-width: 26px !important; 
        height: 26px !important; 
        padding: 0 !important;
    }
    
    /* NEU MOBILE: Kopfzeile kompakter und zentrierter */
    .calendar-table th.day-header { 
        width: 26px !important; 
        min-width: 26px !important; 
        max-width: 26px !important; 
        height: auto !important; 
        padding: 0.15rem 0 0.25rem 0 !important; /* Optisch zentriert, wenig Platzverbrauch */
        font-size: 0.5rem !important; 
        line-height: 1.1 !important;
    }
    .calendar-table th.day-header .text-base { 
        font-size: 0.65rem !important; 
        line-height: 1 !important; 
        display: block; 
        margin-top: 2px !important; 
    }
    
    /* Text in der mobilen Spalte kompakter machen */
    .calendar-table tbody .wohnung-name-cell { 
        font-size: 0.65rem !important; 
        line-height: 1 !important;
        padding: 0 0.4rem !important; 
        display: table-cell !important; 
        vertical-align: middle !important; 
        height: 26px !important; 
    }
    
    .segment { top: 3px !important; bottom: 3px !important; }
    .segment-shape-single { left: 2px !important; width: calc(100% - 4px) !important; }
}

.selection-segment { position: absolute; top: 8px; bottom: 8px; display: block; z-index: 10; pointer-events: none; }
.selection-segment-start { background-color: #34d399; border-radius: 8px 0 0 8px; left: 50%; width: 50%; }
.selection-segment-mid { background-color: #a5f3fc; left: -1px; width: calc(100% + 2px); }
.selection-segment-end { background-color: #a5f3fc; border-radius: 0 8px 8px 0; left: 0; width: 50%; }
.selection-segment-invalid { background-color: rgba(220, 38, 38, 0.6) !important; border: 1px dashed rgba(127, 29, 29, 0.8); }

/* Verhindert den unnötigen vertikalen Scrollbalken */
div[id^="calendar-scroll-container-"] {
    overflow-y: hidden !important;
    padding-bottom: 8px;
}
