/* reservation/static/reservation/css/space_detail.css */

/* 共通セクション */
.detail-section {
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.9rem 1rem;
  background-color: #ffffff;
}

.section-header h6 {
  font-size: 0.9rem;
}

.section-header--booking {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
}

.section-header--booking .section-header-title {
  font-size: 0.96rem;
  line-height: 1.15;
  white-space: nowrap;
}

.section-header-actions {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

/* 写真スライダー */
.photo-viewer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.photo-main-wrapper {
  position: relative;
  border-radius: 0.8rem;
  overflow: hidden;
  background: #0f172a;
}

/* 写真枠：比率固定（モバイルに合わせる） */
.photo-main-wrapper {
  position: relative;
  border-radius: 0.8rem;
  overflow: hidden;
  background: #0f172a;

  /* ★ここが肝：比率を固定（まずは 4:3 推奨） */
  aspect-ratio: 4 / 3;
}

/* 写真：枠にぴったりフィット */
.photo-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* placeholderも枠に合わせる */
.photo-main.placeholder {
  height: 100%;
  min-height: 0;
}

.photo-main.placeholder {
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #f8fafc, #e2e8f0);
}

.photo-main.placeholder .placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: #64748b;
}

.photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background-color: rgba(15, 23, 42, 0.55);
  color: #f9fafb;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-nav.prev {
  left: 0.5rem;
}

.photo-nav.next {
  right: 0.5rem;
}

.photo-thumbs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.photo-thumb-btn {
  border: none;
  padding: 0;
  background: transparent;
  border-radius: 0.5rem;
  overflow: hidden;
  flex: 0 0 56px;
  height: 56px;
  border: 2px solid transparent;
}

.photo-thumb-btn.active {
  border-color: rgba(79, 70, 229, 0.8);
}

.photo-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 利用状況テーブル */
.availability-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

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

.legend-available {
  background-color: #ffffff;
  border: 1px solid #E6E8EB;
}

.legend-unavailable {
  background-color: #E6E8EB;
}

/* スクロール可能なタイムスロットテーブル */
.availability-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.availability-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.availability-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #f8fafc;
  font-size: 0.7rem;
  padding: 0.35rem 0.35rem;
  text-align: center;
  white-space: nowrap;
}

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

.room-col {
  text-align: left;
  min-width: 150px;
}

.time-col {
  min-width: 52px;
}

/* スロットセル */
.slot {
  width: 100%;
  height: 18px;
  border-radius: 4px;
}

.slot-available {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
}

.slot-unavailable {
  background-color: #E6E8EB;
}

/* ルームリンク */
.room-link {
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.room-link:hover {
  text-decoration: underline;
}

/* 横スクロールバーがコンテンツに被らないように余白を確保 */
.ts-table-wrapper {
  padding-bottom: 20px;              /* ← ここが効く（スクロールバー分の下余白） */
  scrollbar-gutter: stable both-edges; /* 対応ブラウザならガタつき防止 */
}

/* 左列（ルーム列）を見やすくする：背景と余白 */
.ts-room-col {
  padding-bottom: 0.4rem; /* 行の下に少し余白。スクロールバーと視覚的に分離 */
}

/* ルーム名リンクを「押せる」見た目に*/
/*
.ts-room-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(13, 110, 253, 0.35);
  background: rgba(13, 110, 253, 0.06);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
}*/

/* 右矢印を付ける（視覚的に「遷移する」ことが一目で分かる） */
.ts-room-link::after {
  content: "›";
  font-size: 1rem;
  line-height: 1;
  opacity: 0.75;
}

/* hover / focus で明確に */
.ts-room-link:hover {
  background: rgba(13, 110, 253, 0.12);
  border-color: rgba(13, 110, 253, 0.6);
}

.ts-room-link:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.35);
  outline-offset: 2px;
}

.calendar-modal {
  border: 0;
  border-radius: 1.45rem;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
}

#common-calendar-modal .modal-dialog {
  transform: none !important;
}

.calendar-modal .modal-header {
  padding: 1.3rem 1.35rem 0.45rem;
}

.calendar-modal .modal-title {
  font-size: 1.9rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.calendar-modal .modal-body {
  padding: 0 1.35rem 1.35rem;
}

.calendar-modal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.calendar-legend-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(203, 213, 225, 0.55);
}

.calendar-legend-pill.is-available {
  background: #d7efe4;
  color: #4e7866;
}

.calendar-legend-pill.is-limited {
  background: #f3e2be;
  color: #966c31;
}

.calendar-legend-pill.is-unavailable {
  background: #e4e8ee;
  color: #697586;
}

.calendar-legend-pill.is-holiday {
  background: #f2d7d7;
  color: #9e6969;
}

.calendar-modal-toolbar {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) 2.6rem;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.calendar-modal-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  width: 2.6rem;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  font-size: 1.05rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-modal-nav:hover {
  background: rgba(248, 250, 252, 1);
  border-color: rgba(96, 165, 250, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

.calendar-modal-nav:focus-visible {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.12);
}

.calendar-modal-title {
  text-align: center;
  font-weight: 800;
  color: #0f172a;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.calendar-modal-weekdays,
.calendar-modal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.calendar-modal-weekday {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.calendar-modal-day {
  min-height: 4.6rem;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 1rem;
  background: #fff;
  padding: 0.58rem 0.54rem 0.52rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.035);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.calendar-modal-day:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 12px 26px rgba(59, 130, 246, 0.1);
}

.calendar-modal-day.is-outside {
  opacity: 0.34;
}

.calendar-modal-day.is-selected {
  border-color: rgba(59, 130, 246, 0.72);
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.96) 0%, rgba(219, 234, 254, 0.8) 100%);
  box-shadow:
    0 0 0 0.16rem rgba(59, 130, 246, 0.15),
    0 14px 28px rgba(59, 130, 246, 0.08);
}

.calendar-modal-day.is-available {
  background: linear-gradient(180deg, rgba(246, 250, 248, 0.98) 0%, rgba(215, 239, 228, 0.92) 100%);
}

.calendar-modal-day.is-limited {
  background: linear-gradient(180deg, rgba(251, 248, 242, 0.98) 0%, rgba(243, 226, 190, 0.92) 100%);
}

.calendar-modal-day.is-holiday {
  background: linear-gradient(180deg, rgba(251, 247, 247, 0.98) 0%, rgba(242, 215, 215, 0.92) 100%);
}

.calendar-modal-day.is-unavailable:disabled {
  background: linear-gradient(180deg, rgba(249, 250, 252, 0.98) 0%, rgba(228, 232, 238, 0.94) 100%);
}

.calendar-modal-day:disabled {
  cursor: not-allowed;
}

.calendar-modal-day.is-loading {
  min-height: 4.15rem;
  padding-top: 0.34rem;
  padding-bottom: 0.38rem;
  background: linear-gradient(180deg, rgba(249, 250, 252, 0.98) 0%, rgba(236, 240, 245, 0.94) 100%);
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: none;
  justify-content: flex-start;
  gap: 0.28rem;
}

.calendar-modal-day.is-loading .calendar-modal-day-num,
.calendar-modal-day.is-loading .calendar-modal-day-badge {
  color: transparent;
}

.calendar-modal-day.is-loading .calendar-modal-day-num::after,
.calendar-modal-day.is-loading .calendar-modal-day-badge::after {
  content: "";
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(226,232,240,0.85) 0%, rgba(241,245,249,0.95) 50%, rgba(226,232,240,0.85) 100%);
  background-size: 200% 100%;
  animation: calendar-skeleton-shimmer 1.2s linear infinite;
}

.calendar-modal-day.is-loading .calendar-modal-day-num::after {
  width: 1.1rem;
  height: 0.92rem;
  margin-top: 0.14rem;
}

.calendar-modal-day.is-loading .calendar-modal-day-badge::after {
  width: 1.5rem;
  height: 0.72rem;
}

.calendar-modal-day-num {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.calendar-modal-day-badge {
  align-self: center;
  border-radius: 999px;
  min-width: 1.9rem;
  justify-content: center;
  padding: 0.14rem 0.42rem;
  font-size: 0.62rem;
  font-weight: 800;
  color: #475569;
  opacity: 0.92;
}

@keyframes calendar-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 575.98px) {
  .calendar-modal-day {
    min-height: 4rem;
  }
}

/* ===============================
   Date picker: < [date] > unified (space_detail)
   =============================== */
.rr-date-group{
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.85rem;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(15,23,42,0.06);
}

.rr-date-group--sm{
  grid-template-columns: 36px 1fr 36px;
}

.booking-date-group {
  width: min(100%, 22rem);
}

.rr-date-btn{
  height: 36px;
  border: 0;
  background: rgba(248,250,252,0.9);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease, opacity 120ms ease;
}

.rr-date-btn:hover{ background: rgba(13,110,253,0.08); }
.rr-date-btn:active{ background: rgba(13,110,253,0.14); }

.rr-date-btn:disabled{
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(248,250,252,0.7);
}

.rr-date-input{
  height: 36px;
  border: 0;
  padding: 0 0.6rem;
  font-size: 0.82rem;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  min-width: 0;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.rr-date-input:focus{ outline: none; }

.rr-date-group:focus-within{
  border-color: rgba(13,110,253,0.55);
  box-shadow: 0 0 0 4px rgba(13,110,253,0.14);
}

@media (max-width: 575.98px) {
  .section-header--booking {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 0.6rem;
  }

  .section-header-actions {
    justify-content: stretch;
  }

  .booking-date-group {
    width: 100%;
  }
}

/* Space description structured blocks */
.room-spec {
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.7);
  padding: 0.9rem 1rem;
}

.room-spec-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
  color: #0f172a;
}

.room-spec-header i {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(31, 58, 95, 0.08);
  color: #1f3a5f;
  font-size: 0.85rem;
}

.spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
}

.map-embed-wrap {
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #fff;
}

.map-embed-wrap iframe {
  width: 100%;
  height: 260px;
  border: 0;
  display: block;
}

#booking-section {
  scroll-margin-top: 84px;
}

.space-mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.98) 70%,
    rgba(255, 255, 255, 0)
  );
  border-top: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.space-mobile-cta .btn {
  min-height: 46px;
  font-weight: 700;
}

.space-mobile-cta.is-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.space-mobile-cta-spacer {
  height: 84px;
}

@media (min-width: 992px) {
  .space-mobile-cta,
  .space-mobile-cta-spacer {
    display: none;
  }
}
