/* ============================================================
   VouchCord — demo.css
   Interactive "leave a vouch" demo, built to look and behave
   exactly like the real /vouch flow inside Discord:
   rating select -> comment modal -> proof select -> product select
   -> posted vouch embed. Reuses .embed-preview-* (site.css) for the
   final vouch so it is 1:1 with the bot.
   ============================================================ */

.vouch-demo {
  /* Discord palette (scoped, never leaks into the site theme) */
  --dc-bg: #313338;
  --dc-bg-alt: #2b2d31;
  --dc-bg-dark: #1e1f22;
  --dc-bg-darker: #111214;
  --dc-blurple: #5865f2;
  --dc-blurple-hover: #4752c4;
  --dc-green: #248046;
  --dc-green-hover: #1a6334;
  --dc-text: #dbdee1;
  --dc-head: #f2f3f5;
  --dc-muted: #b5bac1;
  --dc-faint: #949ba4;
  --dc-star: #f0b232;
  --dc-embed: #8200ff; /* server embed color (bot default) */

  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--dc-bg);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(124, 58, 237, 0.15);
  font-family: ui-sans-serif, system-ui, "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--dc-text);
}

/* ── Channel header ── */
.vd-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--dc-bg-alt);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dc-muted);
  flex-shrink: 0;
}

.vd-hash { color: #80848e; font-weight: 700; }

/* ── Message stream ── */
.vd-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
  overflow-y: auto;
  min-height: 452px;
  max-height: 560px;
}

.vd-msg { display: flex; gap: 14px; align-items: flex-start; }
.vd-msg--enter { animation: vdMsgIn 0.3s ease both; }

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

.vd-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: contain;
  padding: 4px;
  background: var(--dc-bg-dark);
  box-sizing: border-box;
}

.vd-content { flex: 1; min-width: 0; padding-top: 2px; }

.vd-authorline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
  line-height: 1.375;
}

.vd-name { font-weight: 500; font-size: 1rem; color: var(--dc-head); }

.vd-tag {
  display: inline-flex;
  align-items: center;
  height: 15px;
  padding: 0 4px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: var(--dc-blurple);
  border-radius: 3px;
}

.vd-time { font-size: 0.75rem; color: var(--dc-faint); font-weight: 400; }
.vd-text { font-size: 0.9rem; color: var(--dc-text); line-height: 1.4; }

/* ── Discord embed (interaction prompts + success) ── */
.dc-embed {
  margin-top: 8px;
  max-width: 432px;
  background: var(--dc-bg-alt);
  border-radius: 4px;
  border-left: 4px solid var(--dc-embed);
  padding: 12px 16px 14px;
}

.dc-embed__title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--dc-head);
  margin-bottom: 6px;
}

.dc-embed__desc {
  font-size: 0.85rem;
  color: var(--dc-muted);
  line-height: 1.45;
}

.dc-embed__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 10px;
}

.dc-embed__field { margin-top: 12px; }

.dc-embed__field-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dc-head);
  margin-bottom: 2px;
}

.dc-embed__field-val { font-size: 0.85rem; color: var(--dc-text); line-height: 1.5; }

.dc-embed__desc strong { color: var(--dc-head); font-weight: 600; }

.dc-embed__footer {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--dc-faint);
}

/* Components row under an embed */
.dc-components { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; max-width: 432px; }

/* ── Ephemeral footer ("Only you can see this • Dismiss message") ── */
.dc-eph {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--dc-faint);
}

.dc-eph svg { width: 15px; height: 15px; flex-shrink: 0; }
.dc-eph__sep { opacity: 0.6; }
.dc-eph__dismiss { color: var(--dc-faint); }

/* ── Buttons (Discord) ── */
.dc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: var(--dc-blurple);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  width: fit-content;
}

.dc-btn:hover { background: var(--dc-blurple-hover); }
.dc-btn:disabled { opacity: 0.5; cursor: default; }
.dc-btn--success { background: var(--dc-green); }
.dc-btn--success:hover { background: var(--dc-green-hover); }
.dc-btn--secondary { background: #4e5058; }
.dc-btn--secondary:hover { background: #6d6f78; }
.dc-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.dc-btn__emoji { font-size: 1rem; line-height: 1; }

/* ── Discord select menu ── */
.dc-select { position: relative; max-width: 400px; }

.dc-select__control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--dc-faint);
  background: var(--dc-bg-dark);
  border: 1px solid var(--dc-bg-dark);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.dc-select__control:hover { border-color: #020202; }
.dc-select.is-open .dc-select__control { border-color: var(--dc-blurple); }

.dc-select__chevron { flex-shrink: 0; width: 18px; height: 18px; color: var(--dc-faint); transition: transform 0.15s ease; }
.dc-select.is-open .dc-select__chevron { transform: rotate(180deg); }

.dc-select__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 12;
  padding: 6px;
  max-height: 216px;
  overflow-y: auto;
  background: var(--dc-bg-darker);
  border: 1px solid #030303;
  border-radius: 4px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
  display: none;
}

.dc-select.is-open .dc-select__menu { display: block; animation: vdMsgIn 0.1s ease both; }

.dc-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.dc-option:hover { background: var(--dc-blurple); }
.dc-option__emoji { font-size: 1.05rem; line-height: 1; flex-shrink: 0; }
.dc-option__body { min-width: 0; }
.dc-option__label { font-size: 0.9rem; color: var(--dc-text); }
.dc-option__desc { font-size: 0.78rem; color: var(--dc-faint); }
.dc-option:hover .dc-option__label,
.dc-option:hover .dc-option__desc { color: #fff; }

/* ── Modal (comment) ── */
.dc-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  animation: vdFade 0.15s ease both;
}

@keyframes vdFade { from { opacity: 0; } to { opacity: 1; } }

.dc-modal {
  width: 100%;
  max-width: 440px;
  background: var(--dc-bg);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: vdModalIn 0.18s ease both;
}

@keyframes vdModalIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

.dc-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 0;
}

.dc-modal__title { font-size: 1.2rem; font-weight: 600; color: var(--dc-head); }

.dc-modal__close {
  background: none;
  border: none;
  color: var(--dc-faint);
  cursor: pointer;
  padding: 2px;
  line-height: 0;
}

.dc-modal__close:hover { color: var(--dc-head); }
.dc-modal__close svg { width: 22px; height: 22px; }

.dc-modal__body { padding: 16px; }

.dc-field-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--dc-muted);
  margin-bottom: 8px;
}

.dc-field-label .req { color: #f23f42; margin-left: 2px; }

.dc-modal__input {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--dc-text);
  background: var(--dc-bg-dark);
  border: 1px solid #1e1f22;
  border-radius: 4px;
  resize: none;
  outline: none;
  transition: border-color 0.12s ease;
}

.dc-modal__input:focus { border-color: var(--dc-blurple); }
.dc-modal__input.is-error { border-color: #f23f42; }
.dc-modal__input::placeholder { color: #4e5058; }

.dc-modal__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.dc-field-error { font-size: 0.78rem; color: #f23f42; visibility: hidden; }
.dc-field-error.is-shown { visibility: visible; }
.dc-charcount { font-size: 0.75rem; color: var(--dc-faint); margin-left: auto; }

.dc-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  background: var(--dc-bg-alt);
}

.dc-modal__cancel {
  background: none;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 9px 16px;
  cursor: pointer;
  border-radius: 4px;
}

.dc-modal__cancel:hover { text-decoration: underline; }

/* ── Proof upload (simulated "send an image") ── */
.dc-proof-samples { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.dc-proof-thumb {
  width: 92px;
  height: 64px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: var(--dc-bg-dark);
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.dc-proof-thumb:hover { border-color: var(--dc-blurple); transform: translateY(-2px); }
.dc-proof-thumb img, .dc-proof-thumb svg { width: 100%; height: 100%; display: block; }

/* Proof image inside the posted embed */
.embed-preview-image {
  margin-top: 10px;
  max-width: 100%;
  border-radius: 4px;
  display: block;
}

/* ── Replay + success line ── */
.vd-replay {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--dc-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.vd-replay:hover {
  color: var(--dc-head);
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.12);
}

.vd-replay svg { width: 15px; height: 15px; }

/* ── Live-demo caption (below the Discord window, in site styling) ── */
.vd-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 0 4px;
}

.vd-note__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.vd-note__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: sitePulse 2s ease-in-out infinite;
}

.vd-note__reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.vd-note__reset:hover {
  color: var(--text-bright);
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.1);
}

.vd-note__reset svg { width: 14px; height: 14px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .vd-msg--enter,
  .dc-select.is-open .dc-select__menu,
  .dc-modal-backdrop,
  .dc-modal { animation: none; }
  .vd-messages { scroll-behavior: auto; }
  .dc-proof-thumb:hover { transform: none; }
}

@media (max-width: 480px) {
  .vd-messages { min-height: 400px; padding: 12px; }
  .vd-avatar { width: 34px; height: 34px; }
}
