/* ---------------------------------------------
   Room Calendars — Combined Styles
   Busy + Requested + Selection highlight + Full Minimum Modal + Mobile UX
   --------------------------------------------- */

/* =============================
   BUSY EVENT STYLING (BOOKED)
   ============================= */

.fc .crc-busy-event {
  border-radius: 6px;
  overflow: hidden;
  border: none !important;
}

.fc .crc-busy-event .fc-event-main {
  color: rgba(255,255,255,0.95);
  background-image:
    repeating-linear-gradient(
      135deg,
      rgba(255,255,255,0.18) 0px,
      rgba(255,255,255,0.18) 6px,
      rgba(255,255,255,0.00) 6px,
      rgba(255,255,255,0.00) 12px
    ),
    linear-gradient(
      rgba(184,191,194,0.85),
      rgba(184,191,194,0.85)
    );
  border-radius: 6px;
}

.fc .crc-busy-event .fc-event-main-frame {
  padding: 2px 6px;
}

/* =============================
   REQUESTED EVENT STYLING
   ============================= */

.fc .crc-selection-event {
  border-radius: 6px !important;
  border: 1px solid rgba(22,55,65,0.45) !important;

  background-color: rgba(22,55,65,0.18) !important;

  --fc-event-bg-color: rgba(22,55,65,0.18) !important;
  --fc-event-border-color: rgba(22,55,65,0.45) !important;
}

.fc .crc-selection-event .fc-event-main {
  background: transparent !important;
  color: rgba(22,55,65,0.95) !important;
}

.fc .crc-selection-event .fc-event-title {
  font-weight: 600 !important;
  font-size: 12px;
}

/* =============================
   SELECTION HIGHLIGHT STYLING
   ============================= */

.crc-room-calendar .fc .fc-highlight {
  background: rgba(22,55,65,0.18) !important;
  border-radius: 6px !important;
}

.crc-room-calendar .fc .fc-timegrid-selection {
  border: 1px solid rgba(22,55,65,0.45) !important;
  border-radius: 6px !important;
}

/* Mirror event while dragging */
.crc-room-calendar .fc .fc-event-mirror,
.crc-room-calendar .fc .fc-timegrid-event.fc-event-mirror,
.crc-room-calendar .fc .fc-v-event.fc-event-mirror {
  background: rgba(22,55,65,0.18) !important;
  border: 1px solid rgba(22,55,65,0.45) !important;
  border-radius: 6px !important;

  --fc-event-bg-color: rgba(22,55,65,0.18) !important;
  --fc-event-border-color: rgba(22,55,65,0.45) !important;

  box-shadow: none !important;
}

.crc-room-calendar .fc .fc-event-mirror .fc-event-main {
  background: transparent !important;
  color: rgba(22,55,65,0.95) !important;
}

/* =============================
   LEGEND
   ============================= */

.crc-cal-legend {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

/* =============================
   MINIMUM CONFLICT MODAL (restored)
   ============================= */

.crc-minimum-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
}
.crc-minimum-modal.is-open { display: block; }

.crc-minimum-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.crc-minimum-modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 420px);
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  padding: 16px 16px 14px;
}

.crc-minimum-modal__title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
}

.crc-minimum-modal__body {
  font-size: 14px;
  line-height: 1.35;
  color: rgba(0,0,0,0.75);
  margin-bottom: 14px;
}

.crc-minimum-modal__actions {
  display: flex;
  justify-content: flex-end;
}

.crc-minimum-modal__btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

/* =============================
   MOBILE IMPROVEMENTS
   ============================= */

@media (max-width:768px) {

  /* Prevent long-press selection/copy menu inside calendar */
  .crc-room-calendar,
  .crc-room-calendar * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  /* Allow form fields to remain selectable */
  input, textarea, select, label {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
  }

  /* Taller slots */
  .fc .fc-timegrid-slot {
    height: 2.6em;
  }

  /* Gutter width */
  .fc .fc-timegrid-axis {
    width: 72px !important;
    min-width: 72px !important;
  }

  /* Time labels cushion */
  .fc .fc-timegrid-slot-label {
    font-size: 1rem;
    text-align: left;
  }

  .fc .fc-timegrid-slot-label-cushion {
    padding-left: 4px;
    padding-right: 8px;
    text-align: left;
  }

  /* Bigger tap targets */
  .fc .fc-v-event {
    min-height: 38px;
  }

  .crc-room-calendar {
    overflow-x: hidden;
  }
}

/* --- CRC Legend (Booked / Available / Today) --- */
.crc-cal-legend{
  display:flex;
  align-items:center;
  gap:18px;
  flex-wrap:wrap;
  margin: 10px 0 10px;
}

.crc-cal-legend__item{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(0,0,0,.70);
}

.crc-cal-legend__swatch{
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display:inline-block;
  border: 1px solid rgba(0,0,0,.18);
  box-sizing: border-box;
}

/* Available: white */
.crc-cal-legend__swatch--free{
  background: #fff;
}

/* Booked: hatched (matches your busy block vibe) */
.crc-cal-legend__swatch--busy{
  background:
    repeating-linear-gradient(
      45deg,
      rgba(22,55,65,.18) 0px,
      rgba(22,55,65,.18) 6px,
      rgba(22,55,65,.06) 6px,
      rgba(22,55,65,.06) 12px
    );
  border-color: rgba(22,55,65,.28);
}

/* Today: match FullCalendar "today" tint (uses FC variable if present) */
.crc-cal-legend__swatch--today{
  background: var(--fc-today-bg-color, rgba(255, 220, 40, 0.15));
  border-color: rgba(0,0,0,.12);
}

/* --- CRC Legend tweak: slightly larger swatches for readability --- */
.crc-cal-legend__swatch{
  width: 14px !important;
  height: 14px !important;
  border-radius: 4px !important;
}

/* --- Booking summary formatting --- */
.crc-booking-summary__title{
  margin: 0 0 6px;
}
.crc-booking-summary__row{
  display:flex;
  gap:8px;
  line-height: 1.25;
  margin: 2px 0;
}
.crc-booking-summary__k{
  min-width: 48px;
  opacity: .75;
}
.crc-booking-summary__v{
  font-weight: 700;
}
