/* ── 실시간 투표 및 댓글 위젯 스타일 ── */

:root {
  --widget-bg-a: rgba(23, 165, 204, 0.08);
  --widget-bg-b: rgba(43, 79, 162, 0.08);
  --widget-bg-c: rgba(217, 130, 43, 0.08);
}

#voting-widget-root {
  margin-top: 3.2rem;
  color: var(--ink);
}

/* 투표 카드 */
.vote-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.4rem;
  margin-bottom: 4.8rem;
}

.vote-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 2.8rem 2.4rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.vote-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px -8px rgba(12, 34, 51, 0.16);
}

.vote-card--a { border-top: 4px solid var(--a); }
.vote-card--b { border-top: 4px solid var(--b); }
.vote-card--c { border-top: 4px solid var(--c); }

.vote-card--a.voted { background-color: var(--widget-bg-a); border-color: var(--a); }
.vote-card--b.voted { background-color: var(--widget-bg-b); border-color: var(--b); }
.vote-card--c.voted { background-color: var(--widget-bg-c); border-color: var(--c); }

.vote-card__header {
  display: flex;
  align-items: center;
  margin-bottom: 1.6rem;
}

.vote-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.8rem;
  margin-right: 1.2rem;
}

.vote-card--a .vote-card__badge { background: var(--a-tint); color: var(--a-ink); }
.vote-card--b .vote-card__badge { background: var(--b-tint); color: var(--b-ink); }
.vote-card--c .vote-card__badge { background: var(--c-tint); color: var(--c-ink); }

.vote-card__title {
  font-size: 1.8rem;
  font-weight: 700;
}

.vote-card__desc {
  font-size: 1.4rem;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 2.4rem;
  flex-grow: 1;
}

.vote-card__progress-wrapper {
  margin-bottom: 2.4rem;
}

.vote-card__progress-bg {
  background: var(--line-soft);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}

.vote-card__progress-fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 1s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.vote-card--a .vote-card__progress-fill { background: var(--a); }
.vote-card--b .vote-card__progress-fill { background: var(--b); }
.vote-card--c .vote-card__progress-fill { background: var(--c); }

.vote-card__stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink-3);
}

.vote-card__percentage {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
}

.vote-card__btn {
  width: 100%;
  padding: 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.vote-card--a .vote-card__btn:hover { background: var(--a-tint); border-color: var(--a); color: var(--a-ink); }
.vote-card--b .vote-card__btn:hover { background: var(--b-tint); border-color: var(--b); color: var(--b-ink); }
.vote-card--c .vote-card__btn:hover { background: var(--c-tint); border-color: var(--c); color: var(--c-ink); }

.voted .vote-card__btn {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

/* 피드백 영역 레이아웃 */
.feedback-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4.8rem;
  align-items: start;
}

@media (max-width: 900px) {
  .feedback-layout {
    grid-template-columns: 1fr;
    gap: 3.6rem;
  }
}

/* 댓글 폼 */
.comment-form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 3.2rem;
  box-shadow: var(--shadow);
}

.comment-form-panel__title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  margin-bottom: 1.6rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.form-group label {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink-2);
}

.form-control {
  padding: 1.2rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  font-family: inherit;
  font-size: 1.5rem;
  color: var(--ink);
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--ink-2);
  box-shadow: 0 0 0 3px var(--line-soft);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.comment-submit-btn {
  width: 100%;
  padding: 1.4rem;
  border: none;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 1.6rem;
}

.comment-submit-btn:hover {
  background: var(--ink-2);
}

/* 댓글 목록 */
.comments-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.comments-panel__title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comments-count-badge {
  font-size: 1.4rem;
  background: var(--line);
  color: var(--ink-2);
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
}

.comments-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

/* Custom Scrollbar for Comments */
.comments-list::-webkit-scrollbar {
  width: 6px;
}
.comments-list::-webkit-scrollbar-track {
  background: transparent;
}
.comments-list::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}
.comments-list::-webkit-scrollbar-thumb:hover {
  background: var(--ink-3);
}

.comment-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(12, 34, 51, 0.03);
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.comment-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.comment-card__author-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.comment-card__author {
  font-weight: 700;
  font-size: 1.5rem;
}

.comment-card__date {
  font-size: 1.2rem;
  color: var(--ink-3);
}

.comment-card__body {
  font-size: 1.5rem;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.comment-card__delete-btn {
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.4rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.comment-card__delete-btn:hover {
  background: var(--line-soft);
  color: #c93b2b;
}

.no-comments {
  text-align: center;
  padding: 4.8rem 2.4rem;
  color: var(--ink-3);
  font-size: 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.comments-load-more-btn {
  display: block;
  width: 100%;
  padding: 1.2rem;
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.comments-load-more-btn:hover {
  background: var(--line-soft);
}

/* QR Code Floating Button & Modal */
.qr-float-btn {
  position: fixed;
  bottom: 2.4rem;
  right: 2.4rem;
  z-index: 1000;
  background: var(--ink);
  color: var(--surface);
  border: none;
  border-radius: 50px;
  padding: 1.2rem 2.4rem;
  font-weight: 700;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(12, 34, 51, 0.25);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.qr-float-btn:hover {
  transform: translateY(-2px);
  background: var(--ink-2);
  box-shadow: 0 6px 24px rgba(12, 34, 51, 0.3);
}

.qr-float-btn svg {
  width: 1.8rem;
  height: 1.8rem;
}

.qr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 34, 51, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1010;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.qr-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.qr-modal__content {
  background: var(--surface);
  border-radius: var(--r);
  padding: 3.6rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(12, 34, 51, 0.3);
  text-align: center;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.qr-modal.active .qr-modal__content {
  transform: scale(1);
}

.qr-modal__close {
  position: absolute;
  top: 1.6rem;
  right: 1.6rem;
  background: none;
  border: none;
  font-size: 2.4rem;
  cursor: pointer;
  color: var(--ink-3);
  line-height: 1;
}

.qr-modal__title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--ink);
}

.qr-modal__desc {
  font-size: 1.4rem;
  color: var(--ink-2);
  margin-bottom: 2.4rem;
}

.qr-modal__img-wrapper {
  background: #f4f7f9;
  padding: 1.6rem;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 1.6rem;
  box-shadow: inset 0 2px 4px rgba(12, 34, 51, 0.05);
}

.qr-modal__img {
  width: 220px;
  height: 220px;
  display: block;
}

.qr-modal__url {
  font-size: 1.3rem;
  color: var(--ink-3);
  background: var(--line-soft);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  word-break: break-all;
  user-select: all;
}
