/* ============================================================================
   予約カレンダー用CSS - ふくサロン 高級感のある色プラン (15分単位対応版)
   ============================================================================ */

/* ナビゲーションボタン */
.week-navigation {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.nav-btn {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.3em;
  font-weight: bold;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(184, 149, 108, 0.3);
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(184, 149, 108, 0.4);
}

.nav-btn.today-btn {
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--brown) 100%);
}

/* 時間カレンダーコンテナ */
.time-calendar-container {
  width: 100%;
  overflow: auto;
  /* ★変更: 行数倍増に伴い、画面外へ伸びすぎるのを防ぐため高さを制限 */
  /* スマホ等でもヘッダー固定で見やすくするため vh (ビューポートの高さ) 指定に変更 */
  max-height: 70vh; 
  /* max-height: 1800px; ← 元の値 */
  
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative; /* スクロール時の基準点 */
}

.time-scroll-wrapper-vertical {
  min-width: 100%;
}

/* 7日間カレンダーテーブル */
.week-calendar-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0; /* ボーダーのズレを防ぐ */
  background: rgba(232, 221, 208, 0.5);
}

/* ヘッダー(日付) */
.week-calendar-table thead th {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, var(--brown) 0%, var(--gold) 100%);
  color: var(--white);
  font-weight: bold;
  border: 1px solid var(--brown);
  z-index: 10;
  /* ★追加: ヘッダーの上下幅を少し調整 */
  padding: 8px 0;
}

/* ★追加: 月行（1段目）のフォントを1.2倍に */
.week-calendar-table thead tr:nth-child(1) th.month-header,
.week-calendar-table thead tr:nth-child(1) th.time-header {
  font-size: 1.2em;
}

/* ★追加: 日付行（2段目）は月行の高さ分だけ下にずらして固定
   → スクロール時に月行が日付行に隠れて消えるのを防ぐ */
.week-calendar-table thead tr:nth-child(2) th {
  top: 41px; /* 月行のフォント拡大後の高さに合わせて調整 */
}

.week-calendar-table thead th.today {
  background: linear-gradient(135deg, var(--dark-brown) 0%, var(--brown) 100%);
}

.week-calendar-table thead th.sunday {
  background: linear-gradient(135deg, #c4766c 0%, #d4948a 100%);
}

.week-calendar-table thead th.saturday {
  background: linear-gradient(135deg, #6c9ab8 0%, #8ab4cc 100%);
}

.week-calendar-table thead th.selected {
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  border: 2px solid var(--white);
}


/* 時間ラベルセル */
.time-label-cell {
  background: var(--cream);
  color: var(--text);
  text-align: center;
  /* ★追加: 時間ラベルを左端に固定（横スクロール時） */
  position: sticky;
  left: 0;
  z-index: 5;
  border-right: 2px solid var(--brown); /* 固定列の境界線 */
  font-size: 0.85em; /* 文字を少し小さく */
  padding: 4px 2px;
}

/* 時間セル */
.time-cell {
  border: 1px solid var(--beige);
  text-align: center;
  /* ★変更: 15分刻みなので高さをコンパクトに調整 */
  padding: 2px 1px; /* 上下パディングを縮小 (元: 3px 3px) */
  height: 30px;     /* 高さを固定して均一化 */
  
  transition: all 0.3s;
  cursor: pointer;
  min-width: 35px; /* タップ領域確保のため少し広げる */
}

.time-cell span {
  /* ★追加: 記号(◎/×)の配置調整 */
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  font-size: 0.9em;
}

.time-cell.available {
  background: var(--white) !important;
}
.time-cell.available:hover {
  background: var(--cream) !important;
  transform: scale(1.05);
  box-shadow: none;
}

.time-cell.unavailable {
  background: #eaeaea !important;
  cursor: not-allowed;
}

.time-cell.current-time {
  border: 2px solid var(--gold);
  background-color: rgba(184, 149, 108, 0.2);
  box-shadow: 0 0 8px rgba(184, 149, 108, 0.5);
}

/* 状態マーク */
.status-mark {
  display: inline-block;
}

.available-mark {
  color: #4caf50;
  font-weight: bold; /* 視認性アップ */
}

.unavailable-mark {
  color: #4f4f4f;
  font-size: 0.8em; /* ×印は少し控えめに */
}

/* スマホ対応 */
@media (max-width: 768px) {
  .nav-btn {
    padding: 10px 8px;
    font-size: 1.3em;
  }
  
  /* スマホではさらに高さを意識 */
  .time-cell {
    height: 28px;
    font-size: 0.9em;
  }
  
  .time-label-cell {
    font-size: 0.75em;
    padding: 2px;
    min-width: 40px;
  }
  
  /* ヘッダーの日付文字サイズ調整 */
  .date-number {
    font-size: 1.1em;
  }
  .day-of-week {
    font-size: 0.8em;
  }
}