/* ============================================
   混雑予想カレンダー — Libre Minimal Style
   ============================================ */

/* ページヘッダー */
.crowd-header {
  text-align: center;
  padding: 64px 24px 24px;
}
.crowd-header .page-title {
  display: block;
  font-family: "Noto Serif JP", serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}
.crowd-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 16px;
  line-height: 1.7;
}
.crowd-description {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.9;
  max-width: 600px;
  margin: 0 auto 36px;
  padding: 12px 20px;
  border-left: 2px solid var(--border);
  text-align: left;
  letter-spacing: 0.02em;
}

/* パーク切り替え */
.park-switch {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--border);
  padding: 3px;
}
.park-switch-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  border: none;
  background: transparent;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
  letter-spacing: 0.04em;
}
.park-switch-btn:hover { color: var(--text); }
.park-switch-btn.active {
  color: #fff;
}
.park-switch-btn[data-park="tdl"].active { background: var(--tag-restaurant); }
.park-switch-btn[data-park="tds"].active { background: var(--tag-attraction); }
.park-switch-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: box-shadow 0.3s;
}
.park-switch-dot--tdl { background: var(--tag-restaurant); }
.park-switch-dot--tds { background: var(--tag-attraction); }
.park-switch-btn.active .park-switch-dot { background: rgba(255,255,255,0.6); }

/* 凡例 */
.crowd-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  padding: 0 24px 36px;
  max-width: 780px;
  margin: 0 auto;
}
.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.legend-dot {
  display: block;
  width: 100%;
  height: 6px;
  flex-shrink: 0;
  transition: background 0.3s var(--ease-out);
}
.legend-item:first-child .legend-dot { border-radius: 3px 0 0 3px; }
.legend-item:last-child .legend-dot { border-radius: 0 3px 3px 0; }
.legend-item span:last-child {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-weight: 400;
  white-space: nowrap;
}

/* カレンダーナビゲーション */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 24px 28px;
}
.cal-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
}
.cal-nav-btn:hover {
  border-color: var(--text);
}
.cal-nav-btn svg {
  width: 16px;
  height: 16px;
  color: var(--text-sub);
}
.cal-month-title {
  font-family: "Noto Serif JP", serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
  width: 200px;
  text-align: center;
  letter-spacing: 0.06em;
}

/* カレンダーグリッド */
.cal-grid-wrapper {
  width: 780px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px 36px;
  box-sizing: border-box;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 1px;
  background: var(--border);
}
.cal-weekday {
  text-align: center;
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  color: #fff;
  padding: 8px 0;
  background: var(--text);
  letter-spacing: 0.06em;
}
.cal-weekday.sun { color: rgba(255,200,200,0.9); }
.cal-weekday.sat { color: rgba(180,210,255,0.9); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
}

/* 日付セル */
.cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 4px 10px;
  cursor: pointer;
  transition: background 0.4s var(--ease-out);
  border: 2px solid transparent;
  min-height: 90px;
  background: var(--card);
}
.cal-cell:hover {
  background: var(--surface);
  z-index: 2;
}
.cal-cell.selected {
  border-color: var(--accent);
  z-index: 3;
}
/* 過去日 */
.cal-cell.past {
  opacity: 0.4;
}
.cal-cell.past:hover {
  opacity: 0.6;
}

/* TODAY */
.cal-cell.today {
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--accent);
}
.cal-cell.today .cal-day {
  color: var(--accent);
  font-weight: 700;
}
.cal-cell.today::after {
  content: "TODAY";
  position: absolute;
  top: 2px;
  right: 3px;
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 0.42rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 1px 4px;
  letter-spacing: 0.06em;
  line-height: 1.3;
}
.cal-cell.empty {
  background: var(--surface);
  cursor: default;
  min-height: 90px;
}
.cal-cell.empty:hover {
  background: var(--surface);
}

/* 日付 */
.cal-day {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  margin-bottom: 4px;
}
.cal-cell.sun .cal-day { color: #b05050; }
.cal-cell.sat .cal-day { color: #5080b0; }

/* ランクバッジ */
.cal-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 24px;
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 2px;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

.cal-rank-label {
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--text-sub);
  margin-top: 3px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.cal-price {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-sub);
  margin-top: 3px;
  letter-spacing: -0.02em;
  transition: color 0.3s var(--ease-out);
}

/* API料金取得中のローディング表示 */
.cal-cell .cal-price.loading::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--text-muted);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 4px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 選択日の詳細 */
.day-detail {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px 28px;
}
.day-detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 28px 32px;
  animation: slideUp 0.4s var(--ease);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.day-detail-card h3 {
  font-family: "Noto Serif JP", serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.detail-row:last-child { border-bottom: none; }

.detail-park-label {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 4px 14px;
  color: #fff;
  min-width: 60px;
  text-align: center;
  letter-spacing: 0.06em;
}
.detail-park-label.tdl { background: var(--tag-restaurant); }
.detail-park-label.tds { background: var(--tag-attraction); }

.detail-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.3s;
}
.detail-level-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.detail-comment {
  font-size: 0.85rem;
  color: var(--text-sub);
  font-weight: 300;
  margin-left: auto;
}

/* 月間サマリー */
.month-summary {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px 36px;
}
.month-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 28px 32px;
}
.month-summary-card h3 {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: 0.06em;
}

.summary-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.summary-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.summary-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 72px;
  text-align: right;
  font-weight: 300;
}
.summary-bar-track {
  flex: 1;
  height: 6px;
  background: var(--surface);
  overflow: hidden;
}
.summary-bar-fill {
  height: 100%;
  transition: width 0.8s var(--ease), background 0.3s var(--ease-out);
}
.summary-bar-count {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-sub);
  min-width: 32px;
}

/* おすすめ日 */
.best-days {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}
.best-days h4 {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.06em;
}
.best-days h4::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0.5;
}
.best-days-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.best-day-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
}
.best-day-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.best-day-chip .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* 待ち時間テーブル */
.wait-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.wait-area-row td {
  font-family: "Noto Serif JP", serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-sub);
  padding: 14px 0 6px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
}
.wait-table tr:not(.wait-area-row) td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.wait-name {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  padding-right: 12px !important;
  padding-left: 8px !important;
}
.wait-pa {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 1px 4px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}
.wait-bar-cell {
  width: 30%;
  padding-right: 12px !important;
}
.wait-bar-track {
  height: 5px;
  background: var(--surface);
  width: 100%;
}
.wait-bar-fill {
  height: 100%;
  transition: width 0.6s var(--ease);
}
.wait-time {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-sub);
  white-space: nowrap;
  text-align: right;
}

/* ホテルカテゴリ切り替え（1段目） */
.hotel-category-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  margin-bottom: 12px;
}
.hotel-cat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px solid var(--border);
  background: transparent;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}
.hotel-cat-btn:hover { border-color: var(--text-sub); }
.hotel-cat-btn.active {
  background: var(--cat-color, var(--text));
  color: #fff;
  border-color: var(--cat-color, var(--text));
}
.hotel-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hotel-cat-btn.active .hotel-cat-dot {
  background: rgba(255,255,255,0.5) !important;
}

/* ホテル切り替え（2段目） */
.hotel-switch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}
.hotel-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hotel-switch-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: transparent;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}
.hotel-switch-btn:hover { border-color: var(--text-sub); }
.hotel-switch-btn.active {
  background: var(--hotel-color, var(--text));
  color: #fff;
  border-color: var(--hotel-color, var(--text));
}
.hotel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hotel-switch-btn.active .hotel-dot {
  background: rgba(255,255,255,0.5) !important;
}

/* ホテル料金比較 */
.hotel-compare {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hotel-compare-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.hotel-compare-row:last-child { border-bottom: none; }
.hotel-compare-row.active { background: var(--accent-soft); padding: 10px 12px; margin: 0 -12px; }
.hotel-compare-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hotel-compare-name {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.hotel-compare-price {
  font-size: 0.9rem;
  font-weight: 600;
  font-family: "Inter", "Noto Sans JP", sans-serif;
}
.hotel-compare-label {
  font-size: 0.68rem;
  font-weight: 400;
  min-width: 50px;
  text-align: right;
}
.hotel-compare-book {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}
.hotel-compare-row { text-decoration: none; }
.hotel-book-btn {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  padding: 6px 16px;
  text-decoration: none;
  margin-left: auto;
  transition: background 0.3s var(--ease-out);
}
.hotel-book-btn:hover { background: var(--text); color: #fff; }

/* 前後月セル */
.cal-cell.adjacent {
  background: var(--surface);
  cursor: pointer;
  opacity: 0.5;
}
.cal-cell.adjacent:hover { opacity: 0.8; }
.cal-cell.adjacent .cal-day { color: var(--text-muted); }

/* ホテル統計 */
.hotel-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hotel-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 300;
}
.hotel-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  font-family: "Inter", "Noto Sans JP", sans-serif;
  color: var(--text);
}

/* 比較表（ホテル未選択時） */
.compare-section {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px 40px;
}
.compare-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.compare-date-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 16px;
}
.compare-table {
  border: 1px solid var(--border-light);
  overflow: hidden;
}
.compare-row {
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr) 0.7fr;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.2s;
  font-size: 0.82rem;
}
.compare-row.has-selected {
  grid-template-columns: 1.6fr 1fr repeat(3, 0.9fr) 0.7fr;
}
.compare-row:last-child { border-bottom: none; }
.compare-row[data-hotel-id]:hover {
  background: var(--surface);
}
.compare-header {
  background: var(--surface);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: default !important;
}
.compare-cell {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-weight: 500;
  white-space: nowrap;
}
.compare-hotel-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  color: var(--text);
}
.compare-price-main {
  font-size: 0.92rem;
  font-weight: 700;
}
.compare-badge {
  font-size: 0.6rem;
  font-weight: 600;
  color: #fff;
  background: var(--green, #6a9e82);
  padding: 2px 6px;
  line-height: 1;
}
.compare-action {
  text-align: right;
}
.compare-book-btn {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.compare-book-btn:hover {
  text-decoration: underline;
}
.compare-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 16px;
  font-weight: 300;
}

/* カテゴリ最安値表示 */
.cal-price-min {
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 400;
}

/* 比較に戻るボタン */
.hotel-deselect-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-sub);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: "Noto Sans JP", sans-serif;
  transition: all 0.3s var(--ease-out);
}
.hotel-deselect-btn:hover {
  border-color: var(--text-sub);
  color: var(--text);
}

/* 注意書き */
.crowd-note {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px 64px;
}
.crowd-note p {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 4px;
}

/* ============================================
   レスポンシブ
   ============================================ */
@media (max-width: 768px) {
  .crowd-header { padding: 40px 16px 20px; }
  .crowd-header .page-title { font-size: 1.3rem; }
  .crowd-subtitle { font-size: 0.78rem; }
  .crowd-description { font-size: 0.68rem; padding: 10px 16px; max-width: 100%; }

  .park-switch-btn { padding: 8px 20px; font-size: 0.78rem; }
  .hotel-category-switch { flex-wrap: wrap; gap: 6px; }
  .hotel-cat-btn { padding: 7px 14px; font-size: 0.78rem; }
  .hotel-btns { justify-content: center; }

  .crowd-legend { padding: 0 16px 24px; }
  .legend-item span:last-child { font-size: 0.52rem; }

  .cal-month-title { font-size: 1.1rem; width: 160px; }
  .cal-nav-btn { width: 36px; height: 36px; }

  .cal-grid-wrapper { padding: 0 6px 24px; }
  .cal-cell { min-height: 64px; padding: 4px 1px 6px; }
  .cal-cell.empty { min-height: 64px; }
  .cal-day { font-size: 0.7rem; }
  .cal-rank { width: 24px; height: 18px; font-size: 0.72rem; }
  .cal-rank-label { font-size: 0.42rem; }
  .cal-price { font-size: 0.5rem; }

  .day-detail { padding: 0 12px 20px; }
  .day-detail-card { padding: 20px; }
  .detail-row { flex-wrap: wrap; gap: 8px; }
  .detail-comment { margin-left: 0; }

  .month-summary { padding: 0 12px 24px; }
  .month-summary-card { padding: 20px; }
  .wait-name { font-size: 0.7rem; }
  .wait-time { font-size: 0.68rem; }
  .wait-bar-cell { width: 20%; }

  .crowd-note { padding: 0 12px 40px; }

  .compare-section { padding: 0 12px 32px; }
  .compare-row {
    grid-template-columns: 1.4fr repeat(3, 1fr) 0.6fr;
    padding: 10px 12px;
    font-size: 0.72rem;
  }
  .compare-row.has-selected {
    grid-template-columns: 1.3fr 0.9fr repeat(3, 0.8fr) 0.6fr;
  }
  .compare-hotel-name { font-size: 0.72rem; }
}

@media (max-width: 480px) {
  .cal-cell { min-height: 52px; padding: 3px 0 4px; }
  .cal-cell.empty { min-height: 52px; }
  .cal-day { font-size: 0.62rem; }
  .cal-rank { width: 22px; height: 16px; font-size: 0.65rem; }
  .cal-rank-label { display: none; }
  .cal-price { font-size: 0.45rem; }
  .cal-weekday { font-size: 0.62rem; padding: 6px 0; }
  .cal-cell.today::after { display: none; }
  .crowd-legend { display: none; }
  .park-switch-btn { padding: 7px 16px; font-size: 0.75rem; }
}
