@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #12141c;
  --surface: #1a1d29;
  --surface-2: #232735;
  --border: #2c3040;
  --text: #eef0f5;
  --text-muted: #8b93a7;
  --accent: #ffb347;      /* like / primary */
  --accent-ink: #1a1206;  /* text on accent */
  --share: #6bcf7f;       /* share */
  --downvote: #5eb8ff;    /* downvote */
  --danger: #ff6b6b;      /* errors, destructive */
  --radius: 10px;
  --radius-lg: 16px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button {
  font-family: var(--font-body);
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mono { font-family: var(--font-mono); }

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.field input,
.field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.error-banner {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: var(--danger);
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 16px;
  display: none;
}
.error-banner.visible { display: block; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Shared modal (used for the share panel) */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 11, 16, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.modal-head h3 { font-family: var(--font-display); font-size: 16px; margin: 0; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; line-height: 1; padding: 4px;
}
.modal-close:hover { color: var(--text); }

.share-option { margin-bottom: 16px; }
.share-option label {
  display: block; font-size: 12.5px; color: var(--text-muted);
  margin-bottom: 6px; font-weight: 500;
}
.share-option-row { display: flex; gap: 8px; }
.share-option-row input,
.share-option-row textarea {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.share-option-row textarea { resize: vertical; min-height: 60px; }
.copy-btn {
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 600;
}
.copy-btn:hover { color: var(--text); border-color: var(--text-muted); }
.copy-btn.copied { color: var(--share); border-color: var(--share); }
.share-note {
  font-size: 11.5px; color: var(--text-muted); margin-top: -4px; margin-bottom: 16px;
}
