/* ==============================
   リセット・ベース
   ============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary:       #d94b3a;
  --color-primary-dark:  #b83a2b;
  --color-dark:          #2c3e50;
  --color-gray:          #7f8c8d;
  --color-light:         #f2f3f5;
  --color-white:         #ffffff;
  --color-border:        #e0e0e0;
  --color-success:       #27ae60;
  --color-error:         #e74c3c;
  --color-warning:       #f39c12;
  --color-text:          #2c3e50;
  --color-text-light:    #7f8c8d;
  --color-surface:       #ffffff;
  --color-rank1:         #f5a623;
  --color-rank2:         #a0a0a0;
  --color-rank3:         #c07850;
  --font-base:           'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  --radius:              8px;
  --radius-sm:           4px;
  --shadow:              0 2px 8px rgba(0,0,0,.10);
  --shadow-md:           0 4px 16px rgba(0,0,0,.12);
}

body {
  font-family: var(--font-base);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-light);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==============================
   ヘッダー
   ============================== */
.site-header {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.site-header-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-white);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
.site-logo:hover { text-decoration: none; opacity: .9; }
.site-logo-icon { font-size: 20px; }
.site-logo-text { white-space: nowrap; }
.site-nav { display: flex; gap: 16px; }
.site-nav a { color: rgba(255,255,255,.88); font-size: 13px; font-weight: 700; }
.site-nav a:hover { color: #fff; text-decoration: none; }
.site-nav a.nav-current { color: #fff; text-decoration: underline; }

/* ==============================
   名古屋グリーンテーマ
   ============================== */
body.nagoya-theme {
  --color-primary:       #388e3c;
  --color-primary-dark:  #2e7d32;
}

body.nagoya-theme .city-radio:has(input:checked) {
  background: #e8f5e9;
}

body.nagoya-theme .tab-btn:hover {
  background: #e8f5e9;
}

/* ==============================
   参考価格（fallback）スタイル
   ============================== */
.fallback-separator {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-light);
  padding: 8px 0 4px;
  border-top: 1px dashed var(--color-border);
  margin-top: 4px;
}

.hotel-card--fallback {
  opacity: 0.82;
  border-left: 3px solid var(--color-border);
}

.rank--ref {
  background: var(--color-border);
  color: var(--color-text-light);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}

.fallback-note {
  font-size: 11px;
  color: var(--color-warning);
  background: #fffbf0;
  border: 1px solid #f0d060;
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}

.result-count-sub {
  font-size: 12px;
  font-weight: normal;
  color: var(--color-text-light);
  margin-left: 4px;
}

/* ==============================
   メインコンテンツ
   ============================== */
.container { max-width: 640px; margin: 0 auto; padding: 14px 14px 40px; }

/* ==============================
   フッター
   ============================== */
.site-footer {
  background: var(--color-dark);
  color: rgba(255,255,255,.7);
  font-size: 12px;
  padding: 20px 16px;
  margin-top: 40px;
}
.site-footer-inner { max-width: 640px; margin: 0 auto; }
.footer-disclaimer { margin-bottom: 12px; line-height: 1.8; }
.footer-nav { display: flex; gap: 16px; margin-bottom: 12px; }
.footer-nav a { color: rgba(255,255,255,.6); font-size: 12px; }
.footer-nav a:hover { color: #fff; text-decoration: none; }
.footer-copy { color: rgba(255,255,255,.45); }

/* ==============================
   共通部品
   ============================== */
.back-link { margin-bottom: 12px; font-size: 13px; }
.back-link a { color: var(--color-gray); }
.back-link a:hover { color: var(--color-primary); text-decoration: none; }

.city-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--color-light);
  border: 1px solid var(--color-border);
  color: var(--color-text-light);
  padding: 1px 6px;
  border-radius: 10px;
}
.section-title { font-size: 17px; font-weight: 700; margin: 12px 0 10px; }
.no-result {
  text-align: center;
  color: var(--color-text-light);
  padding: 40px 16px;
  font-size: 14px;
  line-height: 1.8;
}
.text-right { text-align: right; }
.price-cell { font-weight: 700; color: var(--color-primary); white-space: nowrap; }
.price-tilde { font-size: 14px; vertical-align: top; }
.price-unknown { color: var(--color-text-light); font-size: 12px; }

/* ==============================
   ボタン
   ============================== */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: opacity .15s;
}
button.btn { display: block; width: 100%; }
.btn:hover { opacity: .88; text-decoration: none; }
.btn:active { opacity: .75; }
.btn-primary { background: var(--color-primary); color: var(--color-white); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  padding: 8px 14px;
}
.btn-sm { font-size: 13px; padding: 7px 14px; border-radius: 6px; }

/* ==============================
   スクロールピッカー UI（トップ）
   ============================== */
.picker-wrap {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px 14px;
  margin-bottom: 14px;
}
.picker-wrap h2 {
  font-size: 15px;
  color: var(--color-text-light);
  margin-bottom: 14px;
  text-align: center;
}
.picker-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 12px;
}
.picker-col { display: flex; flex-direction: column; align-items: center; flex: 1; }
.picker-col label {
  font-size: 11px;
  color: var(--color-text-light);
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: .04em;
}
.picker-drum {
  width: 100%;
  height: 140px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}
.picker-drum::before,
.picker-drum::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 44px;
  pointer-events: none;
  z-index: 2;
}
.picker-drum::before { top: 0;    background: linear-gradient(to bottom, rgba(255,255,255,.95), transparent); }
.picker-drum::after  { bottom: 0; background: linear-gradient(to top,   rgba(255,255,255,.95), transparent); }
.picker-highlight {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 40px;
  transform: translateY(-50%);
  border-top:    2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  pointer-events: none;
  z-index: 1;
}
.picker-list {
  list-style: none;
  padding: 50px 0;
  transition: transform .15s ease;
  touch-action: pan-y;
}
.picker-list li {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text);
  user-select: none;
}
.picker-list li.selected { color: var(--color-primary); font-weight: 700; }

/* エリア選択 */
.city-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 14px;
}
.city-label { font-size: 13px; color: var(--color-text-light); font-weight: 700; }
.city-radio {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-light);
  transition: all .15s;
}
.city-radio:has(input:checked) {
  border-color: var(--color-primary);
  background: #fde8e6;
  color: var(--color-primary);
}
.city-radio input { display: none; }

/* ==============================
   検索バー（search.php）
   ============================== */
.search-bar {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.search-bar-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.search-bar-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 70px;
}
.search-bar-item label {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-light);
  letter-spacing: .04em;
}
.search-bar-item input,
.search-bar-item select {
  padding: 6px 8px;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-light);
}
.search-bar-item input:focus,
.search-bar-item select:focus { outline: none; border-color: var(--color-primary); }

/* 検索条件サマリー */
.result-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.result-date { font-weight: 700; }
.result-time { color: var(--color-text-light); }
.result-city {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}
.result-count { margin-left: auto; font-weight: 700; color: var(--color-primary); }

/* ==============================
   ホテルカード（検索結果）
   ============================== */
.hotel-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid transparent;
}
.hotel-card--top {
  border-left-color: var(--color-rank1);
  box-shadow: 0 3px 12px rgba(245,166,35,.2);
}
.rank { font-size: 22px; font-weight: 700; min-width: 30px; text-align: center; }
.rank--1 { color: var(--color-rank1); }
.rank--2 { color: var(--color-rank2); }
.rank--3 { color: var(--color-rank3); }
.hotel-card .info { flex: 1; min-width: 0; }
.hotel-card .hotel-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}
.hotel-card .plan-label { font-size: 12px; color: var(--color-text-light); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.town-label { font-size: 12px; color: var(--color-text-light); margin-left: 4px; }
.geo-bar { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.geo-status { font-size: 12px; color: var(--color-text-light); }
.distance-label { font-size: inherit; color: inherit; font-weight: inherit; margin-top: 2px; }
.map-link { font-size: 12px; color: #1a73e8; white-space: nowrap; }
.map-link:hover { text-decoration: underline; }
.btn-map { border-color: #1a73e8; color: #1a73e8; }
.hotel-card .price {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  text-align: right;
  line-height: 1.2;
}
.hotel-card .price small { display: block; font-size: 11px; font-weight: normal; color: var(--color-text-light); }

/* 部屋タイプ折りたたみ */
.room-list { margin-top: 6px; font-size: 12px; }
.room-list summary { cursor: pointer; color: var(--color-text-light); font-size: 12px; }
.room-list summary:hover { color: var(--color-primary); }
.room-table { width: 100%; margin-top: 4px; border-collapse: collapse; font-size: 12px; }
.room-table td { padding: 3px 6px; border-bottom: 1px solid var(--color-border); }

/* ==============================
   注意書き・バナー
   ============================== */
.notice {
  background: #fff8e1;
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12px;
  color: #6d5c00;
  margin: 10px 0;
  line-height: 1.8;
}
.holiday-banner {
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 700;
}
.holiday-banner a { color: var(--color-white); text-decoration: underline; }

/* ==============================
   ホテル詳細ページ
   ============================== */
.hotel-detail-header {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.hotel-detail-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.hotel-detail-title h2 { font-size: 20px; font-weight: 700; }
.hotel-detail-sub { font-size: 13px; color: var(--color-text-light); margin-bottom: 4px; }
.hotel-detail-sub a { color: var(--color-primary); }
.hotel-detail-links { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.room-section {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}
.room-section-title {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  background: var(--color-light);
  border-bottom: 1px solid var(--color-border);
}
.room-section-title.single { cursor: default; border-bottom: none; }
.room-section-title::marker,
.room-section-title::-webkit-details-marker { display: none; }

.plan-cat-section { border-bottom: 1px solid var(--color-border); }
.plan-cat-section:last-child { border-bottom: none; }
.plan-cat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  padding: 7px 16px 3px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.price-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.price-detail-table th {
  background: #fafafa;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-light);
  padding: 6px 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.price-detail-table th.text-right { text-align: right; }
.price-detail-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}
.price-detail-table tbody tr:last-child td { border-bottom: none; }
.day-type-cell { font-size: 12px; color: var(--color-text-light); }
.notes-row td { background: #fafff4; }
.notes-cell { font-size: 11px; color: var(--color-text-light); padding: 3px 10px 6px !important; }

/* ==============================
   長期休暇ページ
   ============================== */
.tab-list { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tab-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  border: 2px solid var(--color-primary);
  border-radius: 20px;
  background: transparent;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.tab-btn:hover { background: #fde8e6; text-decoration: none; }
.tab-btn.active { background: var(--color-primary); color: var(--color-white); }
.period-note { font-size: 13px; color: var(--color-text-light); margin-bottom: 12px; }

.holiday-hotel-list { list-style: none; }
.holiday-hotel-row {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.holiday-hotel-name { font-weight: 700; font-size: 15px; margin-right: 6px; }
.holiday-hotel-links { flex-shrink: 0; }

/* ==============================
   管理者画面
   ============================== */
.admin-header {
  background: var(--color-dark);
  color: var(--color-white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header a { color: #aaa; font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); font-size: 14px; }
th { background: var(--color-light); font-weight: 700; }
tr:hover td { background: #fafafa; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-failed  { background: #f8d7da; color: #721c24; }
.badge-skipped { background: #e2e3e5; color: #383d41; }
.badge-fallback{ background: #fff3cd; color: #856404; }

.scrape-log-row { padding: 10px 0; border-bottom: 1px solid var(--color-border); font-size: 14px; }
.scrape-log-row .error-msg { color: var(--color-error); font-size: 13px; margin-top: 4px; }

/* ==============================
   フォーム
   ============================== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.form-group input[type=text],
.form-group input[type=password],
.form-group input[type=url],
.form-group input[type=tel],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-primary); }
.form-group textarea { min-height: 80px; resize: vertical; }

/* ==============================
   ホテル一覧ページ
   ============================== */
.section-lead {
  font-size: 13px;
  color: var(--color-text-light);
  margin-bottom: 16px;
}
.hotels-section { margin-bottom: 24px; }
.hotels-city-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  border-left: 3px solid var(--color-primary);
  padding-left: 8px;
  margin-bottom: 8px;
}
.hotels-list { list-style: none; }
.hotels-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.hotels-item-info { display: flex; flex-direction: column; gap: 2px; }
.hotels-item-name { font-size: 14px; font-weight: 700; color: var(--color-text); }
.hotels-item-address { font-size: 12px; color: var(--color-text-light); }
.hotels-item-links { display: flex; gap: 6px; flex-wrap: wrap; }

/* フッター説明文 */
.footer-description {
  font-size: 11px;
  color: var(--color-gray);
  line-height: 1.7;
  margin-bottom: 10px;
}

/* ==============================
   インストールバナー（PWA）
   ============================== */
.install-banner {
  display: none;
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
  gap: 10px;
  flex-direction: column;
}
.install-banner.show { display: flex; }
.install-banner-text { display: flex; flex-direction: column; gap: 2px; }
.install-banner-text strong { font-size: 14px; color: var(--color-text); }
.install-banner-text span { font-size: 12px; color: var(--color-text-light); }
.install-banner-actions { display: flex; gap: 8px; }

/* ==============================
   インストール手順ページ
   ============================== */
.install-lead { font-size: 14px; color: var(--color-text-light); margin-bottom: 16px; }
.install-section {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.install-os-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.install-os-icon { font-size: 20px; }
.install-steps {
  padding-left: 20px;
  margin-bottom: 10px;
}
.install-steps li {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 4px;
}
.install-note {
  font-size: 12px;
  color: var(--color-text-light);
  background: var(--color-light);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

/* ==============================
   レスポンシブ（PC）
   ============================== */
@media (min-width: 640px) {
  .hotel-card { padding: 18px 20px; }
  .hotel-card .price { font-size: 26px; }
  .picker-list li { font-size: 20px; }
  .install-banner { flex-direction: row; align-items: center; justify-content: space-between; }
}
