/* data-list-3: リスト 3 — 並べ替え */

/* デモコンテナを縦並びにする */
.demo-container {
  display: block;
  padding: 24px;
}

/* ====== リスト本体 ====== */
.dl3-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.10);
  overflow: hidden;
}

/* リストアイテム */
.dl3-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #E5E9F2;
  transition: background 0.1s;
  cursor: grab;
  user-select: none;
}

.dl3-item:last-child { border-bottom: none; }
.dl3-item:hover { background: #F4F7FF; }
.dl3-item:active { cursor: grabbing; }

/* ドラッグ中のアイテム */
.dl3-item.is-dragging {
  opacity: 0.4;
}

/* ドロップ位置インジケーター（上ボーダー） */
.dl3-item.is-over {
  border-top: 2px solid #2B7FE8;
}

/* ドラッグハンドル */
.dl3-handle {
  flex-shrink: 0;
  color: #CBD5E1;
  font-size: 18px;
  cursor: grab;
  padding: 0 4px;
  line-height: 1;
}

.dl3-item:active .dl3-handle { cursor: grabbing; }

/* アバター */
:root {
  --dl3-av1: #2B7FE8;
  --dl3-av2: #10B981;
  --dl3-av3: #F59E0B;
  --dl3-av4: #8B5CF6;
  --dl3-av5: #EF4444;
}

.dl3-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.dl3-avatar[data-color="1"] { background: var(--dl3-av1); }
.dl3-avatar[data-color="2"] { background: var(--dl3-av2); }
.dl3-avatar[data-color="3"] { background: var(--dl3-av3); }
.dl3-avatar[data-color="4"] { background: var(--dl3-av4); }
.dl3-avatar[data-color="5"] { background: var(--dl3-av5); }

/* 本文エリア */
.dl3-body {
  flex: 1;
  min-width: 0;
}

.dl3-name {
  font-size: 14px;
  font-weight: 700;
  color: #1A2332;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl3-meta {
  font-size: 12px;
  color: #6B7280;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ====== ボタンエリア ====== */
.demo-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* サブボタン（順序確認） */
.btn-sub {
  padding: 6px 16px;
  font-size: 13px;
  font-family: sans-serif;
  color: #2B7FE8;
  background: #fff;
  border: 1.5px solid #2B7FE8;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-sub:hover {
  background: #2B7FE8;
  color: #fff;
}

/* リセットボタン */
.reset-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-family: sans-serif;
  color: #5A6A7A;
  background: #fff;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.reset-btn:hover {
  background: #F4F6F9;
  border-color: #9AA5B4;
}

/* ====== 順序確認モーダル ====== */
.dl3-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.dl3-modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.dl3-modal-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: #1A2332;
}

.dl3-modal-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.dl3-modal-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #E5E9F2;
  font-size: 14px;
  color: #1A2332;
}

.dl3-modal-list li:last-child { border-bottom: none; }

.dl3-modal-idx {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #E5E9F2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #5A6A7A;
}

.dl3-modal-close {
  display: block;
  width: 100%;
  padding: 8px;
  font-size: 13px;
  font-family: sans-serif;
  color: #5A6A7A;
  background: #F3F4F6;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.dl3-modal-close:hover { background: #E5E7EB; }

/* サンプルソースヒント */
.source-hint {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: #F4F7FF;
  border-radius: 6px;
  font-size: 13px;
  color: #3D5A80;
  line-height: 1.7;
}

.source-hint code {
  font-family: monospace;
  background: #E8EDF4;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

/* プロンプト補足（注意・ヒント） */
.prompt-notes {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #F9FAFB;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.7;
}

.prompt-note-caution {
  margin: 0 0 8px;
  color: #E65100;
}

.prompt-note-tip {
  margin: 0;
  color: #5A6A7A;
}

/* レスポンシブ */
@media (max-width: 480px) {
  .demo-container { padding: 16px; }
  .dl3-item { gap: 8px; padding: 10px 12px; }
  .dl3-avatar { width: 36px; height: 36px; font-size: 14px; }
  .demo-controls { flex-wrap: wrap; }
}
