/* *
 * ====================================================================
 * SYSTEM-MODUL: TD: tidiria (Frontend: Buchungskalender)
 * Datei:        calendar.css
 * Pfad:         CS/assets/css/calendar.css
 * Version:      0.0.13.3 (Core Beige Fill & Forced High-Visibility iCal Conflict Highlights)
 * Beschreibung: Grid-basiertes Kalender-Layout inkl. erzwungener Konflikt-Markierung für iCal
 * ==================================================================== */

/* --- BASIS LAYOUT & WRAPPER --- */

.calendar-wrapper {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid #dee2e6;
  display: block;
  width: 100%;
}

#calendar-anchor {
  display: grid;
  gap: 0;
  width: max-content;
  background-color: #dee2e6;
}

/* --- STICKY ACHSEN (HORIZONTAL & VERTIKAL GESTAFFELT) --- */

.sticky-left {
  position: sticky;
  left: 0;
  z-index: 15;
  background: #f8f9fa;
}

.sticky-top-1 {
  position: sticky;
  top: 0;
  z-index: 20;
}

.sticky-top-2 {
  position: sticky;
  top: 40px;
  z-index: 20;
}

.sticky-top-1.sticky-left {
  z-index: 30;
  background: #e9ecef;
}

.sticky-top-2.sticky-left {
  z-index: 30;
  background: #e9ecef;
}

/* --- HEADER & ZELLEN-FORMATIERUNG --- */

.room-label {
  width: 150px;
  font-weight: bold;
  border: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  padding-left: 10px;
}

.day-cell {
  background: white;
  width: 40px;
  border: 1px solid #dee2e6;
}

/* --- INAKTIVE RÄUME (Dunkelgrau & Gelb gestreift) --- */

.room-label.room-inactive, .day-cell.room-inactive {
  background: repeating-linear-gradient( 45deg, #343a40, #343a40 10px, #ffc107 10px, #ffc107 20px ) !important;
  color: #ffffff !important;
}

.room-label.room-inactive div {
  color: #ffffff !important;
}

.day-header {
  background: #e9ecef;
  border: 1px solid #dee2e6;
  text-align: center;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #212529;
}

.month-header {
  background: #ced4da;
  font-weight: bold;
  border: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  padding-left: 10px;
}

/* --- BUCHUNGSBLÖCKE & DIAGONALE CHANGEOVER-MARKER --- */

.booking-block {
  height: 24px;
  margin-top: 3px;
  border-radius: 4px;
  padding: 2px 5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
  background: linear-gradient(90deg, transparent 40px, #f5f5dc 40px, #f5f5dc calc(100% - 40px), transparent calc(100% - 40px)) !important;
  border-top: 1px solid #dcdcdc;
  border-bottom: 1px solid #dcdcdc;
  border-left: none;
  border-right: none;
  display: flex;
  align-items: center;
  isolation: isolate;
  z-index: 1;
}

.status-confirmed {
  border-color: #dcdcdc;
}

.booking-block span.booking-text {
  position: relative;
  z-index: 10;
  color: #212529;
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: none;
  margin-left: 20px;
  margin-right: 20px;
}

.booking-block.status-arrival::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 100%;
  background-color: #48bb78;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  z-index: 2;
  pointer-events: none;
}

.booking-block.status-departure::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background-color: #f56565;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  z-index: 3;
  pointer-events: none;
}

.changeover-arrival {
  margin-left: 0;
}

.changeover-departure {
  margin-right: 0;
}

/* --- UX-HIGHLIGHTS & INTERAKTIVE ELEMENTE --- */

.day-header.is-today {
  background: #212529 !important;
  color: #ffffff !important;
  font-weight: bold !important;
}

.today-link-btn {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  margin-left: -10px;
  justify-content: center;
}

.today-link-btn:hover {
  text-decoration: underline;
  color: #0056b3;
}

/* --- iCal SYNCHRONISATIONS-KONFLIKTE (ERZWUNGEN AM ENDE) --- */

div.booking-block.has-conflict {
  border: 2px solid #d99b00 !important;
  background-color: #fffae6 !important;
  background-image: repeating-linear-gradient( 45deg, rgba(255, 193, 7, 0.45), rgba(255, 193, 7, 0.45) 10px, rgba(255, 255, 255, 0.95) 10px, rgba(255, 255, 255, 0.95) 20px ) !important;
}

div.booking-block.has-conflict::after {
  content: '⚠️';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.75rem;
  z-index: 20;
  pointer-events: none;
}

