/* static/reservation/css/timeslots.css */
/* RehaRent: theme-friendly timeslots */

/* ===============================
   Legend
   =============================== */
.ts-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow-x: auto;
}

.ts-legend-date {
  color: #6b7280;
  font-weight: 500;
}

.ts-legend-items {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.ts-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ts-legend-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.ts-legend-available {
  background-color: var(--ts-available);
  border: 1px solid var(--ts-unavailable);
}

.ts-legend-unavailable {
  background-color: var(--ts-unavailable);
}

.ts-legend-selected {
  background-color: var(--ts-selected);
}

/* ===============================
   Wrapper & table
   =============================== */
.ts-table-wrapper {
  width: 100%;
  overflow-x: auto;
  position: relative;
}

.ts-table {
  width: max-content;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 0;
}

.ts-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: var(--ts-head-bg);
  font-size: 0.7rem;
  padding: 0.35rem 0;
  text-align: center; /* 時刻ラベルはセンターの方が視認性が良い */
  white-space: nowrap;
}

/* ルーム列のヘッダだけは左寄せ */
.ts-table thead th.ts-room-col {
  text-align: left;
}

.ts-table tbody td,
.ts-table tbody th {
  padding: 0.2rem 0;
}

/* 横線/縦線を td に付ける（重なって見えない） */
.ts-table tbody td{
  border: 1px solid var(--ts-border);
  padding: 0; /* ←隙間防止。今 0.2rem なので “余白” が見える */
}
.ts-table tbody th.ts-room-col{
  border: 1px solid var(--ts-border);
  padding: 0.2rem 0.4rem; /* ルーム列だけは余白を残す */
}


/* ===============================
   Sticky room column (base)
   =============================== */
.ts-room-col {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 5;
  background: #ffffff;
  box-shadow: 0.5px 0 0 rgba(0, 0, 0, 0.06);

  /* 列幅（ベース） */
  min-width: 170px;
  max-width: 170px;
}

/* Header room col should match header background */
.ts-table thead .ts-room-col {
  z-index: 10;
  background: var(--ts-head-bg);
}

.ts-table tbody .ts-room-col {
  z-index: 5;
  background: #ffffff;
}

/* ルーム名の表示領域だけ横スクロール可能にする（スクロール用ラッパー） */
.ts-room-name-wrap {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.ts-room-name-wrap::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

/* room link/span をスクロール領域に収める */
.ts-room-link {
  display: inline-block;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: #0f172a;
}
.ts-room-link:hover {
  text-decoration: underline;
}

/* ===============================
   Time columns & cells
   =============================== */
.ts-time-col {
  /* 時間列の幅（ベース） */
  min-width: 25px;
  width: 25px;
}

.ts-slot-block {
  width: 100%;
  height: 50px;
  border-radius: 0px;
  border: 0px solid var(--ts-border);
  background-color: var(--ts-available);
  box-sizing: border-box;
  /*margin-right: 0rem;
  margin-left: 0rem;
  padding-right: 0rem;
  padding-left: 0rem;*/
}

/* Hover highlight (only when click-select enabled) */
.ts-slot-block.selectable:hover {
  box-shadow: 0 0 0 1px rgba(31, 58, 95, 0.25);
  cursor: pointer;
}

/* Placeholder */
.ts-placeholder {
  font-size: 0.8rem;
}

/* ===============================
   Space detail (mobile) readability
   目的：モバイルで「列幅を詰める」「ルーム名は列内スクロール」
   =============================== */
@media (max-width: 575.98px) {
  /* ルーム列を狭く（sticky維持） */
  .ts-room-col {
    min-width: 104px;
    max-width: 104px;
  }

  /* ブロック高さも少し小さく */
  .ts-slot-block {
    height: 42px;
  }

  .ts-table thead th {
    font-size: 0.66rem;
    padding: 0.3rem 0;
  }
}
