/* ========================================
 * board-notes.css （PitFlow v0.63.0／CarFlow付箋ボードの移植）
 * ダッシュボードの「全体タスク（付箋ボード）」UI
 * ======================================== */

/* ----- ダッシュボード内のセクション ----- */
#board-notes-area { margin: 16px 0 4px; }

/* ヘッダ */
.bn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bn-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bn-header-icon { font-size: 20px; }
.bn-header-title { font-size: 15px; font-weight: 700; color: var(--text1); }
.bn-me {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text3);
}
.bn-me select {
  background: var(--bg1); color: var(--text1);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 6px; font-size: 11px; font-family: inherit;
}
.bn-label-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.bn-label-chip {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; white-space: nowrap; border: 1px solid transparent;
}
.bn-label-red    { background: #ffcdd2; color: #b71c1c; border-color: #ef9a9a; }
.bn-label-orange { background: #ffe0b2; color: #e65100; border-color: #ffcc80; }
.bn-label-yellow { background: #fff9c4; color: #827717; border-color: #fff176; }
.bn-label-green  { background: #c8e6c9; color: #1b5e20; border-color: #a5d6a7; }
.bn-label-blue   { background: #bbdefb; color: #0d47a1; border-color: #90caf9; }

.bn-add-btn {
  background: var(--brand); color: #fff; border: none;
  border-radius: 8px; padding: 7px 14px; font-size: 13px;
  font-weight: 700; cursor: pointer;
}
.bn-add-btn:hover { background: var(--brand-deep); }

/* ----- 付箋グリッド ----- */
.bn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  min-height: 80px;
}
.bn-empty {
  grid-column: 1 / -1;
  padding: 28px 18px;
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text3);
  text-align: center;
  font-size: 13px;
}

/* ----- 付箋カード ----- */
.bn-card {
  position: relative;
  padding: 14px 14px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  transition: transform 0.12s, box-shadow 0.12s;
  color: #1f2937;
  overflow: visible;
}
.bn-card:active { cursor: grabbing; }
.bn-card.is-dragging { opacity: 0.45; transform: rotate(-1deg); }
.bn-card:hover {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.24), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  transform: translateY(-1px);
}
.bn-card.is-overdue { border: 2px solid #d32f2f; }
.bn-card.is-done { opacity: 0.78; cursor: pointer; }
.bn-card.is-done.bn-peek { opacity: 1; }
.bn-card.is-done.bn-peek .bn-done-stamp { opacity: 0.12; }

/* 5色 */
.bn-color-red    { background: linear-gradient(180deg, #ffadad 0%, #ff8c8c 100%); }
.bn-color-orange { background: linear-gradient(180deg, #ffd29a 0%, #ffb774 100%); }
.bn-color-yellow { background: linear-gradient(180deg, #fff5a8 0%, #ffea7a 100%); }
.bn-color-green  { background: linear-gradient(180deg, #b9e7b9 0%, #98d695 100%); }
.bn-color-blue   { background: linear-gradient(180deg, #b6d8ff 0%, #93c2fa 100%); }

/* カード上のラベル */
.bn-card-label {
  position: absolute; top: 8px; right: 36px;
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 3px; background: rgba(255, 255, 255, 0.55);
  color: #2c2c2c; letter-spacing: 0.5px; white-space: nowrap;
  max-width: 55%; overflow: hidden; text-overflow: ellipsis;
}

/* ⋮ メニューボタン */
.bn-menu-btn {
  position: absolute; top: 4px; right: 4px;
  width: 32px; height: 32px; border: none; background: transparent;
  font-size: 20px; font-weight: 700; cursor: pointer;
  color: rgba(0, 0, 0, 0.55); border-radius: 4px; z-index: 5;
  touch-action: manipulation;
}
.bn-menu-btn:hover, .bn-menu-btn:active { background: rgba(0, 0, 0, 0.12); }
@media (max-width: 768px) {
  .bn-menu-btn { width: 40px; height: 40px; font-size: 22px; top: 2px; right: 2px; }
}

/* タイトル */
.bn-title {
  font-size: 15px; font-weight: 700; color: #1f2937;
  line-height: 1.3; padding-right: 40px; margin-bottom: 2px; word-break: break-word;
}
.bn-empty-title { color: rgba(0, 0, 0, 0.4); font-weight: 500; }
.bn-secret-badge {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 4px; margin-right: 5px; vertical-align: middle;
  background: rgba(79, 70, 229, 0.16); color: #4338ca;
  border: 1px solid rgba(79, 70, 229, 0.32); white-space: nowrap;
}

/* 本文 */
.bn-body {
  font-size: 12.5px; color: rgba(0, 0, 0, 0.78); line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}

/* 画像 */
.bn-img {
  width: 100%; max-height: 140px; object-fit: cover; border-radius: 6px;
  cursor: zoom-in; border: 1px solid rgba(0, 0, 0, 0.08);
}

/* 期限 */
.bn-deadline {
  font-size: 11px; font-weight: 600; color: rgba(0, 0, 0, 0.7);
  background: rgba(255, 255, 255, 0.5); padding: 3px 8px; border-radius: 4px; align-self: flex-start;
}
.bn-deadline.is-overdue { background: #d32f2f; color: #fff; }

/* フッター（メンバー＋作成者） */
.bn-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 6px; border-top: 1px dashed rgba(0, 0, 0, 0.18);
}
.bn-members { display: flex; flex-wrap: wrap; }
.bn-members .bn-av { margin-right: -4px; }
.bn-members .bn-av:last-child { margin-right: 0; }
.bn-no-member { font-size: 10px; color: rgba(0, 0, 0, 0.45); font-style: italic; }
.bn-author { display: flex; align-items: center; gap: 5px; font-size: 10px; color: rgba(0, 0, 0, 0.55); }
.bn-author-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* アバター */
.bn-av {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: linear-gradient(135deg, #6abf6a, #378ADD);
  color: #fff; font-weight: 700; border: 1.5px solid #fff; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* 「済」スタンプ */
.bn-done-stamp {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-size: 90px; font-weight: 900; color: rgba(211, 47, 47, 0.85);
  border: 6px solid rgba(211, 47, 47, 0.85); border-radius: 50%;
  width: 130px; height: 130px; display: flex; align-items: center; justify-content: center;
  pointer-events: none; letter-spacing: -4px;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.4); z-index: 5;
  font-family: serif; transition: opacity 0.15s ease;
}

/* ----- 編集モーダル中身（PitFlowの modal-box 内で使う） ----- */
.bn-modal-body { display: flex; flex-direction: column; gap: 12px; }
.bn-modal-body label.bn-lb {
  font-size: 12px; font-weight: 600; color: var(--text2); display: block; margin-bottom: 4px;
}
.bn-modal-body input[type="text"],
.bn-modal-body input[type="date"],
.bn-modal-body textarea {
  width: 100%; padding: 8px 10px; background: var(--bg1);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text1);
  font-size: 13px; box-sizing: border-box; font-family: inherit;
}
.bn-modal-body textarea { resize: vertical; min-height: 80px; }

/* 色選択 */
.bn-color-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.bn-color-picker label {
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 8px; border: 2px solid transparent; border-radius: 8px; transition: 0.12s;
  background: var(--bg2); margin-bottom: 0;
}
.bn-color-picker label:hover { background: var(--bg3); }
.bn-color-picker input[type="radio"] { display: none; }
.bn-color-picker input[type="radio"]:checked + .bn-color-swatch {
  outline: 3px solid var(--accent, #26a269); outline-offset: 1px;
}
.bn-color-swatch { display: block; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.15); }
.bn-color-swatch.bn-sw-red    { background: linear-gradient(180deg, #ffadad, #ff8c8c); }
.bn-color-swatch.bn-sw-orange { background: linear-gradient(180deg, #ffd29a, #ffb774); }
.bn-color-swatch.bn-sw-yellow { background: linear-gradient(180deg, #fff5a8, #ffea7a); }
.bn-color-swatch.bn-sw-green  { background: linear-gradient(180deg, #b9e7b9, #98d695); }
.bn-color-swatch.bn-sw-blue   { background: linear-gradient(180deg, #b6d8ff, #93c2fa); }
.bn-color-pick-label { font-size: 10px; color: var(--text3); }

/* メンバー選択 */
.bn-member-list {
  display: flex; gap: 6px; flex-wrap: wrap; max-height: 160px; overflow-y: auto;
  padding: 4px; background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
}
.bn-member-pick {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 6px; background: var(--bg1); border: 1px solid var(--border);
  border-radius: 16px; font-size: 12px; color: var(--text1); cursor: pointer; margin-bottom: 0;
}
.bn-member-pick.is-checked {
  background: var(--accent, #26a269); color: #fff; border-color: var(--accent, #26a269);
}
.bn-member-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

/* ----- アクションシート（⋮メニュー → 下から出る） ----- */
#modal-bn-actions { align-items: flex-end !important; justify-content: center !important; }
.bn-actionsheet {
  width: 100%; max-width: 480px; background: var(--bg2);
  border-top-left-radius: 14px; border-top-right-radius: 14px;
  padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  display: flex; flex-direction: column; gap: 8px;
  animation: bn-sheet-slide 0.18s ease-out;
}
@keyframes bn-sheet-slide { from { transform: translateY(100%); } to { transform: translateY(0); } }
.bn-actionsheet-title {
  font-size: 13px; font-weight: 700; color: var(--text2); text-align: center;
  padding: 6px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bn-actionsheet-btn {
  width: 100%; padding: 14px 16px; font-size: 16px; font-weight: 600; text-align: left;
  background: var(--bg3); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; touch-action: manipulation;
}
.bn-actionsheet-btn:active { background: var(--bg4); }
.bn-actionsheet-btn.bn-danger { color: #ff6b6b; }
.bn-actionsheet-btn.bn-cancel { text-align: center; margin-top: 4px; background: transparent; border-color: transparent; color: var(--text3); }

/* ----- 返信 ----- */
.bn-replies { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bn-reply { display: flex; align-items: flex-start; gap: 6px; }
.bn-reply-av { flex-shrink: 0; }
.bn-reply-bubble {
  flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 10px; padding: 5px 9px;
}
.bn-reply-text { font-size: 12px; color: rgba(0, 0, 0, 0.8); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bn-reply-time { display: block; font-size: 9.5px; color: rgba(0, 0, 0, 0.42); margin-top: 2px; }
.bn-reply-del {
  flex-shrink: 0; width: 18px; height: 18px; line-height: 16px; text-align: center;
  border: none; background: transparent; color: rgba(0, 0, 0, 0.35); font-size: 15px;
  cursor: pointer; border-radius: 50%; padding: 0;
}
.bn-reply-del:hover { background: rgba(0, 0, 0, 0.08); color: rgba(0, 0, 0, 0.6); }

/* ----- 画像プレビュー ----- */
#modal-bn-image { background: rgba(0, 0, 0, 0.92); align-items: center; justify-content: center; }
#modal-bn-image .bn-image-wrap {
  background: transparent; box-shadow: none; border: none;
  max-width: 95vw; max-height: 95vh; display: flex; align-items: center; justify-content: center;
}
#modal-bn-image img { display: block; width: auto; height: auto; max-width: 92vw; max-height: 92vh; object-fit: contain; cursor: zoom-out; }
.bn-image-close {
  position: fixed; top: 16px; right: 16px; background: rgba(255, 255, 255, 0.18);
  color: #fff; border: none; border-radius: 50%; width: 40px; height: 40px;
  font-size: 20px; cursor: pointer; z-index: 100;
}

/* モバイル */
@media (max-width: 768px) {
  .bn-grid { grid-template-columns: 1fr; }
  .bn-card { min-height: 140px; }
  .bn-done-stamp { font-size: 70px; width: 100px; height: 100px; }
}
