/* =============================
   Central Base - 共通スタイル
   ============================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1A1A2E;
  --accent: #E94560;
  --gold: #F5A623;
  --bg: #F8F9FA;
  --white: #FFFFFF;
  --gray: #6C757D;
  --light-gray: #E9ECEF;
  --text: #212529;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(0,0,0,0.10);
}

body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ヘッダー */
.header {
  background: var(--primary);
  color: var(--white);
  text-align: center;
}

.header-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.header .tagline {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
}

/* ウェルカムバナー */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #16213E 100%);
  color: white;
  padding: 20px 16px;
  text-align: center;
}

.welcome-banner h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.welcome-banner p {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
}

/* セクション共通 */
.section {
  padding: 24px 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon {
  font-size: 20px;
}

.section-sub {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 16px;
  padding-left: 28px;
}

/* カテゴリタブ */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  border: 2px solid var(--light-gray);
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* スポットカード */
.spots-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spot-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  transition: transform 0.2s;
}

.spot-card:active {
  transform: scale(0.98);
}

.spot-emoji {
  width: 80px;
  min-height: 90px;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.spot-card.category-food .spot-emoji { background: #FFF3E0; }
.spot-card.category-sightseeing .spot-emoji { background: #E8F5E9; }
.spot-card.category-cafe .spot-emoji { background: #FFF9C4; }
.spot-card.category-shopping .spot-emoji { background: #FCE4EC; }

.spot-info {
  padding: 12px 14px;
  flex: 1;
}

.spot-category-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}

.spot-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.spot-desc {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 8px;
}

.spot-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spot-tag {
  font-size: 11px;
  background: var(--light-gray);
  color: var(--gray);
  padding: 2px 8px;
  border-radius: 10px;
}

.spot-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #1a73e8;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  background: #E8F0FE;
  margin-left: auto;
}

/* アンケートセクション */
.survey-section {
  background: var(--primary);
  padding: 28px 16px;
  color: white;
}

.survey-section .section-title {
  color: white;
  margin-bottom: 6px;
}

.survey-section .section-sub {
  color: rgba(255,255,255,0.65);
}

.survey-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}

.question-block {
  margin-bottom: 24px;
}

.question-block:last-of-type {
  margin-bottom: 16px;
}

.question-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.question-num {
  display: inline-flex;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  flex-shrink: 0;
}

/* 星評価 */
.star-rating {
  display: flex;
  gap: 6px;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.star-rating input {
  display: none;
}

.star-rating label {
  font-size: 32px;
  cursor: pointer;
  color: #DEE2E6;
  transition: color 0.15s;
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
  color: var(--gold);
}

/* テキストエリア */
.survey-textarea {
  width: 100%;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
}

.survey-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* 送信ボタン */
.submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: opacity 0.2s;
  margin-top: 8px;
}

.submit-btn:active {
  opacity: 0.85;
}

/* 送信完了 */
.thank-you {
  display: none;
  text-align: center;
  padding: 32px 16px;
  background: white;
  border-radius: var(--radius);
  margin-top: 16px;
}

.thank-you .big-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}

.thank-you h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.thank-you p {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
}

/* フッター */
.footer {
  text-align: center;
  padding: 20px 16px;
  font-size: 11px;
  color: var(--gray);
  border-top: 1px solid var(--light-gray);
  background: white;
}

.footer .powered-by {
  font-weight: 700;
  color: var(--primary);
}

/* ==============================
   管理画面スタイル
   ============================== */

.admin-header {
  background: var(--primary);
  color: white;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header h1 {
  font-size: 20px;
  font-weight: 700;
}

.admin-header .badge {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.admin-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* サマリーカード */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.summary-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}

.summary-card .num {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.summary-card .label {
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}

.summary-card .stars {
  font-size: 18px;
  color: var(--gold);
}

/* 回答リスト */
.responses-header {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.clear-btn {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  padding: 4px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.response-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.response-meta {
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 8px;
}

.response-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.score-item {
  font-size: 13px;
}

.score-item .score-label {
  color: var(--gray);
  margin-bottom: 2px;
}

.score-item .score-stars {
  color: var(--gold);
  font-size: 16px;
}

.response-comment {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

.no-data {
  text-align: center;
  padding: 40px;
  color: var(--gray);
  font-size: 14px;
}

/* アンケート内セクションラベル */
.survey-section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg);
  border-left: 4px solid var(--accent);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
}

/* セクション区切り */
.section-divider {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg);
  border-left: 4px solid var(--gold);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  margin: 8px 0 20px;
}

/* ラジオボタングループ */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid var(--light-gray);
  background: white;
  transition: all 0.15s;
}

.radio-option:has(input:checked) {
  border-color: var(--primary);
  background: #EEF0FF;
  font-weight: 600;
}

.radio-option input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.radio-option-other {
  flex-wrap: wrap;
  align-items: center;
}

/* インラインテキスト入力 */
.inline-text {
  border: none;
  border-bottom: 2px solid var(--light-gray);
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  padding: 2px 6px;
  min-width: 100px;
  max-width: 160px;
  color: var(--text);
  transition: border-color 0.2s;
}

.inline-text:focus {
  outline: none;
  border-bottom-color: var(--primary);
}

/* テキスト入力（エリア） */
.text-input {
  width: 100%;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.2s;
}

.text-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* 管理画面：属性タグ行 */
.attr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.attr-tag {
  font-size: 12px;
  background: #EEF0FF;
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

/* ---- Leaflet地図（ゲストページ） ---- */
.guest-map {
  height: 260px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--light-gray);
}
.guest-map::before {
  content: '地図を読み込んでいます...';
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 13px;
  color: var(--gray);
}

/* Leafletポップアップのフォント */
.leaflet-popup-content {
  font-family: 'Noto Sans JP', sans-serif !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}

/* ---- スナップショットボタン ---- */
.snapshot-btn {
  width: 100%;
  padding: 14px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 4px;
  transition: background 0.3s;
}
.snapshot-btn:hover { background: #219a52; }

/* ---- 座標取得ボタン ---- */
.geocode-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.geocode-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ヘッダー背景写真 */
.header {
  position: relative;
  overflow: hidden;
}
.header-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  transition: opacity 0.3s;
}
.header-content {
  position: relative;
  z-index: 1;
  padding: 20px 16px 24px;
  text-align: center;
}

/* エリア地図（スポット上部） */
.area-map-wrap {
  margin-bottom: 16px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.area-map-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  padding: 8px 12px 6px;
  background: white;
  border-bottom: 1px solid var(--light-gray);
}

/* 編集画面：エリア地図プレビューボタン */
.map-preview-btn {
  font-size: 13px;
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
}

/* 編集画面：施設写真大プレビュー */
.large-preview {
  width: 120px !important;
  height: 80px !important;
}

/* 編集画面：ブロックタイトル */
.edit-block-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  padding-left: 4px;
}

/* バージョン履歴カード */
.version-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--light-gray);
}
.version-card.version-latest {
  border-left-color: #2ecc71;
}
.version-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.version-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
}
.version-latest .version-badge {
  background: #2ecc71;
}
.version-time {
  font-size: 12px;
  color: var(--gray);
}
.version-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 10px;
}
.version-body span {
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 6px;
}
.version-restore-btn {
  font-size: 12px;
  color: var(--primary);
  background: none;
  border: 1px solid var(--primary);
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* 写真付きスポットカード */
.spot-photo {
  width: 90px;
  min-height: 90px;
  flex-shrink: 0;
  overflow: hidden;
}
.spot-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 地図埋め込みトグル */
.map-embed-wrap {
  margin-top: 10px;
}
.map-embed-toggle {
  font-size: 12px;
  font-weight: 600;
  color: #1a73e8;
  cursor: pointer;
  padding: 4px 0;
}
.map-embed-area {
  margin-top: 6px;
}

/* =============================
   編集画面スタイル
   ============================= */
.preview-btn {
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
}

.edit-body {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.edit-section-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.edit-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

/* スポット編集カード */
.spot-edit-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}

.spot-edit-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.spot-edit-num {
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.spot-edit-name-preview {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  flex: 1;
}

.spot-delete-btn {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

/* フィールド */
.edit-field {
  margin-bottom: 16px;
}

.edit-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray);
  margin-bottom: 6px;
}

.edit-row {
  display: flex;
  gap: 8px;
}

.edit-row .text-input {
  flex: 1;
}

.emoji-input {
  max-width: 70px !important;
  text-align: center;
  font-size: 20px !important;
}

.select-input {
  flex: 1;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: white;
}

.select-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* 写真エリア */
.photo-edit-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 2px dashed var(--light-gray);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  font-size: 22px;
  text-align: center;
  color: var(--gray);
  line-height: 1.4;
}

.photo-placeholder small {
  display: block;
  font-size: 10px;
}

.photo-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.remove-photo-btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.edit-hint {
  font-size: 11px;
  color: var(--gray);
  margin-top: 5px;
  line-height: 1.5;
}

.edit-hint code {
  background: var(--light-gray);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
}

/* 追加・保存ボタン */
.add-spot-btn {
  width: 100%;
  padding: 14px;
  background: white;
  color: var(--primary);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.2s;
}

.add-spot-btn:hover {
  background: #EEF0FF;
}

.save-all-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.3s;
}

.save-note {
  font-size: 12px;
  color: var(--gray);
  text-align: center;
}

/* レスポンシブ */
@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .summary-card .num {
    font-size: 26px;
  }
  .response-scores {
    grid-template-columns: 1fr;
  }
}
