/* =============================================
   app.css — developChat custom styles
   ============================================= */

/* --- Layout ---------------------------------- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-content {
  flex: 1 0 auto;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}
footer.footer {
  flex-shrink: 0;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  padding: 0.75rem 0;
  font-size: 0.8rem;
  color: #6c757d;
}

/* --- Avatar circles -------------------------- */
.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
}
.avatar-circle.bg-primary   { background-color: #0d6efd !important; }
.avatar-circle.bg-success   { background-color: #198754 !important; }
.avatar-circle.bg-info      { background-color: #0dcaf0 !important; color: #000 !important; }
.avatar-circle.bg-warning   { background-color: #ffc107 !important; color: #000 !important; }
.avatar-circle.bg-secondary { background-color: #6c757d !important; }

/* sizes */
.avatar-circle         { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
.avatar-circle.avatar-sm { width: 2rem;   height: 2rem;   font-size: 0.85rem; }
.avatar-circle.avatar-xs { width: 1.5rem; height: 1.5rem; font-size: 0.7rem; }

/* --- Navbar notification badge --------------- */
.nav-notif-badge {
  position: absolute;
  top: 2px;
  right: 0;
  font-size: 0.6rem;
  min-width: 1rem;
  height: 1rem;
  line-height: 1rem;
  padding: 0 3px;
  border-radius: 10px;
}

/* --- Markdown body --------------------------- */
.markdown-body {
  line-height: 1.8;
  word-break: break-word;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}
.markdown-body h1 { font-size: 1.6rem; border-bottom: 2px solid #dee2e6; padding-bottom: .3rem;}
.markdown-body h2 { font-size: 1.3rem; border-bottom: 1px solid #dee2e6; padding-bottom: .2rem;}
.markdown-body h3 { font-size: 1.1rem; }
.markdown-body p  { margin-bottom: 1rem; }
.markdown-body pre {
  background: #f6f8fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}
.markdown-body code {
  background: #f6f8fa;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.875em;
}
.markdown-body pre code {
  background: transparent;
  padding: 0;
}
.markdown-body blockquote {
  border-left: 4px solid #dee2e6;
  color: #6c757d;
  margin-left: 0;
  padding-left: 1rem;
}
.markdown-body table {
  width: 100%;
  margin-bottom: 1rem;
}
.markdown-body img { max-width: 100%; }

/* --- Markdown editor (form.php) -------------- */
.font-mono { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; }
#markdown-editor { resize: vertical; min-height: 420px; }

/* --- Spec status bar ------------------------- */
.spec-status-bar {
  position: sticky;
  top: 56px; /* below navbar */
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid #dee2e6;
  padding: 0.6rem 0;
}

/* --- Comment thread styling ------------------ */
.comment-item {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
}
.comment-item.comment-unread {
  border-left: 4px solid #0d6efd;
  background: #f0f7ff;
}
.comment-reply {
  border: 1px solid #e9ecef;
  border-radius: 6px;
  background: #f8f9fa;
}
.comment-content {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
  line-height: 1.7;
}
.comment-meta {
  font-size: 0.8rem;
  color: #6c757d;
}

/* --- Dashboard stat cards -------------------- */
.stat-card {
  border: none;
  border-radius: 10px;
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.1) !important;
}
.stat-card .stat-icon {
  font-size: 2.5rem;
  opacity: .8;
}
.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

/* --- Project color accent -------------------- */

/** カード上端のカラーバー（project-card に border-top で適用） */
.project-card {
  border-radius: 10px;
  border: 1px solid #dee2e6;
  transition: transform .15s, box-shadow .15s;
  /* border-top は inline style で上書きされる */
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important;
}

/** プロジェクト詳細・仕様書画面の上端アクセントバー */
.project-color-bar {
  height: 6px;
  border-radius: 3px;
  margin-left: -0.25rem;  /* コンテナの内側幅に合わせる */
  margin-right: -0.25rem;
}

/** カード名前横・パンくず内の丸いカラードット */
.project-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
  border: 2px solid rgba(255,255,255,.6);
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}

/** カラーピッカー スウォッチ */
.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .1s, border-color .1s;
  padding: 0;
  outline: none;
}
.color-swatch:hover {
  transform: scale(1.2);
}
.color-swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px #000, 0 0 0 3px rgba(0,0,0,.2);
  transform: scale(1.15);
}

/* --- Project cards (重複定義を統合) ----------- */

/* --- Extra small utilities ------------------- */
.badge-xs {
  font-size: 0.65rem;
  padding: 2px 6px;
}
.btn-xs {
  font-size: 0.75rem;
  padding: 2px 8px;
  line-height: 1.5;
  border-radius: 4px;
}

/* --- Approval timeline ----------------------- */
.approval-timeline {
  position: relative;
  padding-left: 1.4rem;
}
.approval-timeline::before {
  content: '';
  position: absolute;
  left: .55rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}
.approval-timeline-item {
  position: relative;
  padding-bottom: 1rem;
}
.approval-timeline-item::before {
  content: '';
  position: absolute;
  left: -1.15rem;
  top: .3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #adb5bd;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #dee2e6;
}
.approval-timeline-item.action-approved::before  { background: #198754; }
.approval-timeline-item.action-rejected::before  { background: #dc3545; }
.approval-timeline-item.action-submitted::before { background: #0d6efd; }

/* --- Responsive adjustments ------------------ */
@media (max-width: 767.98px) {
  .spec-status-bar { top: 0; }
  .stat-card .stat-number { font-size: 1.5rem; }
  .markdown-body h1 { font-size: 1.3rem; }
  .markdown-body h2 { font-size: 1.1rem; }
}
