/* 후추봇 접수처 (건의함 & 설문) — "버터 모닝" 리뉴얼 (2026-06) */
/* 기존 bulletin.css 드롭인 교체본. 셀렉터/JS 훅 보존. */
/* 📮 접수처 시그니처 연출: "동네 게시판" —
   건의 카드는 압정으로 꽂은 메모지(살짝 기울어짐), 설문 투표 바는
   형광펜으로 칠해지듯 차오르고, 상태 배지는 스탬프 느낌. */
@import url('style.css');

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 탭 ---------------------------------------------------------------------*/
.bl-tabs {
  display: flex;
  gap: 8px;
  background: var(--color-surface);
  border: 2px solid var(--bm-line);
  border-radius: var(--r-pill);
  padding: 6px;
  box-shadow: var(--sh-card);
}

.bl-tab {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-sec);
  padding: 10px 8px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.2s var(--bm-spring);
}

.bl-tab:hover:not(.active) { transform: translateY(-1px); }

.bl-tab.active {
  background: var(--olive);
  color: #fff;
  box-shadow: 0 2px 0 rgba(92, 99, 57, 0.35);
}

.bl-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 인트로 카드 -------------------------------------------------------------*/
.bl-intro-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--olive-bg), var(--cream));
  border: 2px solid var(--bm-line);
  border-radius: var(--r-card);
  padding: 16px 18px;
  box-shadow: var(--sh-card);
  animation: bmPopIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.05s backwards;
}

.bl-bot-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-surface);
  background: var(--color-surface);
  flex-shrink: 0;
  box-shadow: 0 2px 0 rgba(120, 90, 40, 0.16);
  transform: rotate(-3deg);
  transition: transform 0.25s var(--bm-spring);
}
.bl-bot-avatar:hover { transform: rotate(3deg) scale(1.06); }

.bl-intro-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text);
}

/* 공통 카드·폼 ------------------------------------------------------------*/
.bl-write-card {
  background: var(--color-surface);
  border: 2px solid var(--bm-line);
  border-radius: var(--r-card);
  padding: 18px 20px;
  box-shadow: var(--sh-card);
}

.bl-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bl-token-hint {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--olive-d);
  background: var(--olive-bg);
  border-radius: var(--r-pill);
  padding: 3px 10px;
}

.bl-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.bl-form-greeting {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--color-text);
  font-weight: 600;
}

.bl-textarea,
.bl-input {
  width: 100%;
  border: 2px solid var(--bm-line);
  border-radius: var(--r-small);
  padding: 12px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-cream);
  box-sizing: border-box;
  transition: border-color var(--transition);
}

.bl-textarea {
  resize: vertical;
  min-height: 88px;
}

.bl-textarea--short { min-height: 60px; }

.bl-textarea:focus,
.bl-input:focus {
  outline: none;
  border-color: var(--olive);
  background: var(--color-surface);
}

.bl-input { margin-bottom: 8px; }

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

.bl-input--emoji {
  width: 64px;
  flex-shrink: 0;
  text-align: center;
}

.bl-input--option { flex: 1; }

.bl-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.bl-counter {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.bl-submit-btn {
  border: none;
  background: var(--olive);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(92, 99, 57, 0.35);
  transition: background var(--transition), transform 0.2s var(--bm-spring);
}

.bl-submit-btn:hover { background: var(--olive-d); transform: scale(1.03); }
.bl-submit-btn:active { transform: scale(0.95); }
.bl-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.bl-add-option-btn {
  border: 2px dashed var(--bm-dash);
  background: transparent;
  color: var(--text-sec);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), transform 0.2s var(--bm-spring);
}

.bl-add-option-btn:hover {
  border-color: var(--olive);
  color: var(--olive-d);
  transform: rotate(-0.8deg);
}

.bl-form-error {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--red);
  font-weight: 700;
}

.bl-login-needed {
  text-align: center;
  padding: 12px 0;
}

.bl-login-needed p {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--color-text);
}

.bl-login-sub {
  font-size: 0.85rem;
  font-weight: 400 !important;
  color: var(--text-sec) !important;
}

.bl-home-btn {
  display: inline-block;
  margin-top: 8px;
  background: var(--olive);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  box-shadow: 0 3px 0 rgba(92, 99, 57, 0.35);
  transition: transform 0.2s var(--bm-spring);
}
.bl-home-btn:hover { transform: scale(1.04); }

/* 리스트 ------------------------------------------------------------------*/
.bl-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bl-loading,
.bl-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 18px 0;
  margin: 0;
}

/* 건의 카드 — 압정 메모지 (시그니처) ---------------------------------------*/
.bl-suggest-card {
  background: var(--color-surface);
  border: 2px solid var(--bm-line);
  border-radius: var(--r-card);
  padding: 18px 18px 16px;
  box-shadow: var(--sh-card);
  position: relative;
  animation: bmPopIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  transition: transform 0.25s var(--bm-spring);
}
.bl-suggest-card:nth-child(odd) { transform: rotate(-0.5deg); }
.bl-suggest-card:nth-child(even) { transform: rotate(0.5deg); }
.bl-suggest-card:hover { transform: rotate(0deg) translateY(-2px); }
.bl-list .bl-suggest-card:nth-child(1) { animation-delay: 0.04s; }
.bl-list .bl-suggest-card:nth-child(2) { animation-delay: 0.1s; }
.bl-list .bl-suggest-card:nth-child(3) { animation-delay: 0.16s; }
.bl-list .bl-suggest-card:nth-child(n+4) { animation-delay: 0.22s; }

/* 압정 📌 */
.bl-suggest-card::before {
  content: '📌';
  position: absolute;
  top: -9px;
  left: 18px;
  font-size: 1rem;
  transform: rotate(-12deg);
  filter: drop-shadow(0 2px 2px rgba(120, 95, 45, 0.25));
  z-index: 1;
}

.bl-suggest-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.bl-author {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--color-text);
}

.bl-time {
  font-size: 0.78rem;
  color: var(--muted);
}

/* 상태 배지 — 스탬프 */
.bl-status {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transform: rotate(-2deg);
}

.bl-status--open { background: var(--yellow-l); color: var(--color-text); border: 1.5px dashed var(--bm-dash); }
.bl-status--working { background: var(--orange-bg); color: var(--orange); border: 1.5px solid var(--orange); }
.bl-status--done { background: var(--olive-bg); color: var(--olive-d); border: 1.5px solid var(--olive-l); }
.bl-status--declined { background: var(--color-bg-secondary); color: var(--muted); border: 1.5px solid var(--bm-line); }

.bl-suggest-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 후추봇 답글 말풍선 */
.bl-reply {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.bl-reply-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-warm);
  flex-shrink: 0;
}

.bl-reply-bubble {
  flex: 1;
  background: var(--olive-bg);
  border-radius: 4px var(--r-mini) var(--r-mini) var(--r-mini);
  padding: 10px 14px;
}

.bl-reply-name {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--olive-d);
}

.bl-reply-text {
  margin: 4px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.bl-reply-time {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

/* 설문 카드 ---------------------------------------------------------------*/
.bl-poll-card {
  background: var(--color-surface);
  border: 2px solid var(--bm-line);
  border-radius: var(--r-card);
  padding: 18px 20px;
  box-shadow: var(--sh-card);
  animation: bmPopIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.bl-poll-card--closed { opacity: 0.92; }

.bl-poll-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.bl-poll-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
  flex: 1;
}

.bl-poll-meta {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.bl-poll-desc {
  margin: 4px 0 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-sec);
  white-space: pre-wrap;
  word-break: break-word;
}

.bl-poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bl-poll-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 2px solid var(--bm-line);
  background: var(--color-cream);
  border-radius: var(--r-small);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background var(--transition), transform 0.2s var(--bm-spring);
  overflow: hidden;
}

.bl-poll-option:hover:not(:disabled) {
  border-color: var(--olive);
  transform: translateX(2px);
}

.bl-poll-option:disabled { cursor: default; }

.bl-poll-option--mine {
  border-color: var(--olive);
  background: var(--olive-bg);
  font-weight: 700;
}

.bl-poll-option--winner {
  border-color: var(--olive);
  font-weight: 700;
}

/* 투표 바 — 형광펜 칠 (시그니처) */
.bl-option-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--olive-bg), rgba(246, 231, 168, 0.75));
  z-index: 0;
  transition: width 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bl-poll-option--winner .bl-option-bar {
  background: linear-gradient(90deg, var(--olive-bg), rgba(246, 231, 168, 0.95));
}

.bl-option-emoji,
.bl-option-text,
.bl-option-voters {
  position: relative;
  z-index: 1;
}

.bl-option-emoji { flex-shrink: 0; }
.bl-option-text { flex: 1; word-break: break-word; }

.bl-option-voters {
  font-size: 0.85rem;
  white-space: nowrap;
}

/* 필수 답변 가족 */
.bl-required-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 2px 0 4px;
}

.bl-required-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.bl-required-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-sec);
  cursor: pointer;
}

.bl-required-check input { accent-color: var(--olive); }

.bl-required-hint {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.bl-poll-required {
  margin: 0 0 10px;
  background: var(--purple-bg);
  color: var(--purple-d);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--r-small);
  padding: 8px 12px;
  border: 1.5px dashed var(--purple-l);
}

[data-theme="dark"] .bl-poll-required {
  color: var(--purple-l);
}

.bl-voter-chip--required {
  border: 2px solid var(--purple);
}

/* 투표 현황 / 결과 */
.bl-poll-status {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--text-sec);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bl-voter-chip {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--color-bg-secondary);
  color: var(--muted);
  border: 1.5px solid var(--bm-line);
}

.bl-voter-chip--voted {
  background: var(--olive-bg);
  color: var(--olive-d);
  border-color: var(--olive-l);
}

.bl-poll-result {
  margin-top: 12px;
  background: var(--olive-bg);
  border: 2px dashed var(--olive-l);
  border-radius: var(--r-small);
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--olive-d);
  animation: bmPopIn 0.4s var(--bm-spring);
}

.bl-poll-result--tie {
  background: var(--purple-bg);
  border-color: var(--purple-l);
  color: var(--purple-d);
}

[data-theme="dark"] .bl-poll-result--tie {
  color: var(--purple-l);
}

.bl-poll-comments {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bl-poll-comments li {
  font-size: 0.82rem;
  color: var(--text-sec);
  word-break: break-word;
}

/* 한마디 입력 (투표 시) */
.bl-vote-comment {
  margin-top: 10px;
}

@media (max-width: 480px) {
  .bl-intro-card { flex-direction: row; }
  .bl-intro-card p { font-size: 0.85rem; }
}
