/* ==================================================
   Yuibi Repo Prototype — css/style_create.css
   (Full Screen Layout Version)
   ================================================== */

/* Reset & Base */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden; /* Prevent body scroll */
  display: flex;
  flex-direction: column;
}

.site-header {
  height: 50px; /* Fixed height header */
  flex-shrink: 0;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
  background: #fff;
  z-index: 2000;
}

/* [CH1] Editor Layout Grid */
.editor-layout {
  flex-grow: 1;
  display: grid;
  /* 5 : 2 : 3 Ratio */
  grid-template-columns: 5fr 2fr 3fr; 
  height: calc(100vh - 50px);
  overflow: hidden;
}

/* --- Column 1: Map --- */
.col-map {
  position: relative;
  border-right: 1px solid #ccc;
  height: 100%;
}
#spot-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}
.map-overlay-controls {
  position: absolute;
  top: 10px; left: 50px;
  z-index: 1000;
  background: rgba(255,255,255,0.9);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  pointer-events: none;
  border: 1px solid #ccc;
}

/* --- Column 2: List --- */
.col-list {
  background: #f7f9fc;
  border-right: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.col-header {
  padding: 0.5rem 1rem;
  background: #fff;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.col-header h3 { margin: 0; font-size: 1rem; }
.small-btn {
  padding: 2px 8px; font-size: 0.8rem; cursor: pointer;
}
.scrollable-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

/* Timeline/List Items */
.timeline-row {
  display: grid;
  grid-template-columns: 1fr 20px;
  gap: 5px;
  margin-bottom: 0;
}
.card-spot-wrapper {
  grid-column: 1 / 2;
  padding: 4px 0;
}
.card-spot {
  background: #fff;
  border: 1px solid #ddd;
  border-left: 3px solid #3182ce;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  position: relative;
}
.card-spot.active {
  background: #ebf8ff;
  border-color: #3182ce;
}
.card-route-wrapper {
  grid-column: 1 / 2;
  padding: 5px 0;
}
.card-route {
  background: #fff;
  border: 1px solid #ccc; 
  border-left: 4px solid #38a169;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.85rem;
  color: #444;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-route:hover {
  background: #f0fff4;
  border-color: #38a169;
}
.card-route.active {
  background: #f0fff4;
  border-color: #2f855a;
  box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.2);
}

/* --- Column 3: Editor --- */
.col-editor {
  background: #fff;
  overflow-y: auto;
  height: 100%;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

/* Meta Form */
.meta-details {
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 0.5rem;
  margin-bottom: 1rem;
  background: #fafafa;
}
.route-meta-form label {
  display: block; margin-bottom: 0.5rem; font-size: 0.85rem;
}
.route-meta-form input {
  width: 100%; padding: 4px; border: 1px solid #ccc;
}

/* Properties Body */
.props-header {
  border-bottom: 2px solid #eee;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
}
.props-header h3 { margin: 0; font-size: 1.1rem; }
.badge {
  display: inline-block; padding: 2px 6px; border-radius: 3px;
  color: #fff; font-size: 0.7rem; margin-bottom: 4px;
}
.badge.spot { background: #3182ce; }
.badge.route { background: #38a169; }

.props-body label {
  display: block; margin-bottom: 0.8rem; font-size: 0.9rem; font-weight: bold;
}
.props-body input, .props-body textarea, .props-body select {
  width: 100%; padding: 6px; border: 1px solid #ddd; border-radius: 4px;
  margin-top: 4px; font-weight: normal; font-size: 0.95rem;
}
.props-body textarea {
  min-height: 100px; resize: vertical;
}
.coord-row {
  display: flex; gap: 10px;
}

/* Reference Section Compact */
.ref-section {
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed #ccc;
}
.ref-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
}
.ref-add-area {
  background: #f0f0f0; padding: 8px; border-radius: 4px; margin-top: 10px;
}

/* Footer / Actions */
.divider { border: 0; border-top: 1px solid #eee; margin: 1.5rem 0; }
.editor-footer { font-size: 0.85rem; }
.helper-list { list-style: none; padding: 0; display: flex; gap: 10px; }

.danger-btn { background: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }

@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 400px 300px auto;
    overflow-y: auto;
    height: auto;
  }
}

/* Icon Buttons */
.icon-btn {
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 36px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #555;
}
.icon-btn:hover { background: #f0f0f0; color: #222; }
.icon-btn:active { background: #e2e2e2; }

/* Empty Guide */
.empty-guide {
  text-align: center;
  padding: 2rem 1rem;
  color: #777;
  border: 2px dashed #ccc;
  border-radius: 8px;
  margin: 1rem;
  background: #fff;
}

/* --- (D) 参考文献フォームの改善 --- */
.ref-mode-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  background: #f0f0f0;
  padding: 0.5rem;
  border-radius: 6px;
}
.ref-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  color: #555;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}
.ref-tab:hover {
  background: #e2e2e2;
  color: #222;
}
.ref-tab input[type="radio"] {
  margin: 0;
  accent-color: #3182ce;
  width: 16px;
  height: 16px;
}

/* --- (A)(B) マップ編集用のスタイル --- */

/* ハンドル（実体） */
.edit-handle-solid div {
  background: #fff;
  cursor: grab;
  transition: transform 0.1s;
}
.edit-handle-solid div:hover {
  background: #ebf8ff;
  transform: scale(1.2);
}

/* ハンドル（ゴースト/中間点） */
.edit-handle-ghost div {
  cursor: pointer;
  transition: transform 0.1s;
}
.edit-handle-ghost div:hover {
  background: rgba(49, 130, 206, 0.8) !important;
  transform: scale(1.4);
}

/* ドラッグ中のカーソル */
.leaflet-dragging .leaflet-grab {
  cursor: grabbing;
}

/* ==================================================
   Yuibi Repo Prototype — css/style_create.css
   (Full Screen Layout Version)
   ================================================== */
/* 既存のCSSはそのまま維持し、以下の部分を更新・確認してください */

/* Reset & Base */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden; /* Prevent body scroll */
  display: flex;
  flex-direction: column;
}

/* ... (Header, Grid Layout等は変更なし) ... */
.site-header {
  height: 50px;
  flex-shrink: 0;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
  background: #fff;
  z-index: 2000;
}

.editor-layout {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 5fr 2fr 3fr; 
  height: calc(100vh - 50px);
  overflow: hidden;
}

.col-map {
  position: relative;
  border-right: 1px solid #ccc;
  height: 100%;
}
#spot-map { width: 100%; height: 100%; z-index: 1; }

.col-list {
  background: #f7f9fc;
  border-right: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.col-header {
  padding: 0.5rem 1rem;
  background: #fff;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.scrollable-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.col-editor {
  background: #fff;
  overflow-y: auto;
  height: 100%;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

/* ... (中略: Meta Form, Properties Body等) ... */
/* 必要な部分だけ抜粋して提示しますが、ファイル全体としては前回のものに
   以下の参考文献スタイルを適用してください */

/* --- (D -> C) 参考文献リストのUI改善 --- */
.ref-list-container {
  margin-bottom: 1rem;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fafafa;
}

.ref-item {
  display: flex;
  align-items: center; /* 垂直中央揃え */
  padding: 6px 4px;
  border-bottom: 1px solid #eee;
  background: #fff;
  transition: background 0.2s;
  cursor: grab; /* 全体が掴めるカーソル */
}

.ref-item:last-child {
  border-bottom: none;
}

.ref-item:hover {
  background: #f0f7ff;
}

/* テキスト部分の余白調整 */
.ref-content {
  line-height: 1.4;
  margin-right: 8px; /* 削除ボタンとの距離 */
}

/* 削除ボタン */
.ref-del-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: #fee;
  color: #c00;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* 縮小しない */
  margin-left: auto; /* 右端に寄せるならこれ */
}
.ref-del-btn:hover {
  background: #fcc;
}

/* タブやフォーム周り (前回提示分) */
.ref-mode-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  background: #f0f0f0;
  padding: 0.5rem;
  border-radius: 6px;
}
.ref-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  color: #555;
  padding: 4px 8px;
  border-radius: 4px;
}
.ref-tab:hover { background: #e2e2e2; color: #222; }

/* マップ関連 */
.map-overlay-controls {
  position: absolute;
  top: 10px; left: 50px;
  z-index: 1000;
  background: rgba(255,255,255,0.9);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  pointer-events: none;
  border: 1px solid #ccc;
}

/* アイコンボタン */
.icon-btn {
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 36px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #555;
}

/* カードリスト */
.timeline-row {
  display: grid;
  grid-template-columns: 1fr 20px;
  gap: 5px;
  margin-bottom: 0;
}
.card-spot {
  background: #fff;
  border: 1px solid #ddd;
  border-left: 3px solid #3182ce;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}
.card-spot.active {
  background: #ebf8ff;
  border-color: #3182ce;
}
.card-route {
  background: #fff;
  border: 1px solid #ccc; 
  border-left: 4px solid #38a169;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.85rem;
  color: #444;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-route.active {
  background: #f0fff4;
  border-color: #2f855a;
}