.calendar-matrix {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.calendar-matrix .matrix-header,
.calendar-matrix .matrix-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(36px, 1fr);
  align-items: center;
}
.calendar-matrix .room-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  min-width: 160px;
  max-width: 240px;
  padding: 6px 8px;
  border-right: 1px solid #eee;
}
.calendar-matrix .matrix-cell.header {
  font-weight: 600;
  font-size: 12px;
  color: #555;
  padding: 6px 4px;
  text-align: center;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}
.calendar-matrix .matrix-cell.header.today {
  box-shadow: inset 0 -2px 0 0 #4a90e2;
}
.calendar-matrix .matrix-cell.day {
  height: 28px;
  border-bottom: 1px solid #f2f2f2;
  border-right: 1px solid #f7f7f7;
}
.calendar-matrix .matrix-row:hover .matrix-cell.day {
  background: #fcfcfc;
}
.calendar-matrix .matrix-cell.day.booked { background: #ffd6d6; }
.calendar-matrix .matrix-cell.day.available { background: #e9fbe9; }
.calendar-matrix .matrix-cell.day.campaign { background: #ffeec9; }
.calendar-matrix .matrix-cell.day.today {
  box-shadow: inset 0 0 0 2px #4a90e2;
}
@media (max-width: 768px) {
  .calendar-matrix .room-col { min-width: 140px; }
  .calendar-matrix .matrix-cell.header,
  .calendar-matrix .matrix-cell.day { font-size: 11px; }
}


/* Monthly Booking Calendar Styles */
.monthly-booking-calendar-container {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.monthly-booking-calendar {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.room-selection {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.room-selection label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.room-selector {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.room-selector:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.property-search-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.property-search-filters select {
    min-width: 150px;
    padding: 5px;
}

.property-results {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.property-list h4 {
    margin-top: 0;
    color: #0073aa;
}

.property-item {
    background: #fff;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.property-item h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.property-item p {
    margin: 5px 0;
    font-size: 14px;
}

.calendar-header {
    background: #0073aa;
    color: #fff;
    padding: 20px;
    text-align: center;
}

.calendar-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.calendar-month {
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.month-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.month-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.calendar-nav button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.calendar-nav button:hover {
    background: rgba(255,255,255,0.3);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #f0f0f0;
    padding: 1px;
}

.calendar-day-header {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #666;
}

.calendar-day {
    background: #fff;
    min-height: 80px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calendar-day:hover {
    background: #f8f9fa;
}

.calendar-day.other-month {
    background: #f5f5f5;
    color: #999;
}

.calendar-day.today {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.calendar-day.booked {
    background: #ffebee;
    color: #c62828;
}

.calendar-day.available {
    background: #e8f5e8;
    color: #2e7d32;
}

.calendar-day.cleaning {
    background: #fff3e0;
    color: #ef6c00;
}

.calendar-day.campaign {
    background: #fff3e0;
    color: #f57c00;
    position: relative;
}

.calendar-day.campaign:hover .campaign-tooltip {
    display: block;
}

.campaign-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-top: 5px;
    pointer-events: none;
}

.campaign-tooltip[aria-hidden="false"] {
    display: block;
}

.campaign-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #333;
}

.day-number {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.day-status {
    font-size: 14px;
    font-weight: bold;
    margin-top: 4px;
    text-align: center;
}

.status-booked {
    background: #ffcdd2;
    color: #c62828;
}

.status-available {
    background: #c8e6c9;
    color: #2e7d32;
}

.status-cleaning {
    background: #ffe0b2;
    color: #ef6c00;
}

.calendar-legend {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.legend-available { background: #e8f5e8; }
.legend-booked { background: #ffebee; }
.legend-campaign { background: #fff3e0; }
.legend-today { background: #e3f2fd; border-color: #2196f3; }

/* Calendar day focus and accessibility */
.calendar-day:focus {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
}

.calendar-day[tabindex="0"]:focus {
    background-color: rgba(0, 115, 170, 0.1);
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.error {
    text-align: center;
    padding: 20px;
    color: #d63638;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    margin: 20px;
}

.no-room-selected {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    .monthly-booking-calendar-container {
        margin: 10px;
    }
    
    .calendar-grid {
        font-size: 11px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 3px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .day-status {
        font-size: 12px;
    }
    
    .calendar-header {
        padding: 15px;
    }
    
    .calendar-header h3 {
        font-size: 20px;
    }
    
    .month-header {
        padding: 10px 15px;
    }
    
    .month-header h4 {
        font-size: 16px;
    }
    
    .calendar-legend {
        gap: 10px;
        padding: 15px;
    }
    
    .legend-item {
        font-size: 12px;
    }
    
    .room-selection {
        padding: 10px;
    }
    
    .room-selector {
        font-size: 13px;
    }
    
    .campaign-tooltip {
        font-size: 11px;
        padding: 6px 8px;
    }
}

