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

:root {
  --bg: #0d0d0f;
  --surface: #141417;
  --surface2: #1c1c21;
  --border: #2a2a32;
  --border-light: #35353f;
  --text: #e8e8f0;
  --text-muted: #7a7a8c;
  --text-dim: #4a4a58;
  --accent: #7c6af7;
  --accent-hover: #9080ff;
  --accent-dim: rgba(124, 106, 247, 0.15);
  --danger: #e05c6b;
  --danger-hover: #f07080;
  --success: #4ecb8d;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Syne', sans-serif;
  --radius: 8px;
  --radius-lg: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── Header ─────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.logo {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }

.tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--mono);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ─── Buttons ─────────────────────────────── */
.btn-primary, .btn-ghost, .btn-danger {
  padding: 8px 18px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

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

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(224, 92, 107, 0.3);
}
.btn-danger:hover { background: rgba(224, 92, 107, 0.1); }

/* ─── Home Page Editor ────────────────────── */
.home-page main {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

.editor-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.toolbar-left { display: flex; gap: 4px; }

.tab-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); background: var(--border); }
.tab-btn.active { color: var(--text); background: var(--accent-dim); }

.char-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.editor-pane textarea {
  width: 100%;
  min-height: 380px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.7;
  padding: 20px 24px;
  caret-color: var(--accent);
}

.editor-pane textarea::placeholder { color: var(--text-dim); }

.preview-pane {
  min-height: 380px;
  padding: 20px 24px;
}

.hidden { display: none !important; }

.editor-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
}

.option-group {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.option-group:first-child { border-right: 1px solid var(--border); }

.option-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.option-group label .hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.input-prefix-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.input-prefix {
  padding: 8px 10px 8px 12px;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  background: var(--accent-dim);
  border-right: 1px solid var(--border);
}
.input-prefix-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  padding: 8px 12px;
}

.option-group > input[type="text"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.option-group > input:focus, .input-prefix-wrap:focus-within {
  border-color: var(--accent);
}

.editor-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  justify-content: flex-end;
}

.btn-submit {
  padding: 11px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.btn-submit:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(124, 106, 247, 0.35); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ─── View Page ────────────────────────────── */
.view-page main {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

.paste-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.paste-id {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}

.paste-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ─── Modals ─────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--border); }

.modal textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 12px;
  outline: none;
  resize: vertical;
  line-height: 1.6;
}
.modal textarea:focus { border-color: var(--accent); }

.modal input[type="password"], .modal input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
  padding: 10px 12px;
  outline: none;
}
.modal input:focus { border-color: var(--accent); }

.modal-error {
  color: var(--danger);
  font-size: 0.85rem;
  font-family: var(--mono);
  min-height: 18px;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* Success Modal */
.success-modal { text-align: center; align-items: center; }
.success-icon {
  width: 52px; height: 52px;
  background: rgba(78, 203, 141, 0.15);
  color: var(--success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
}
.success-modal h2 { font-size: 1.3rem; }
.success-modal p { color: var(--text-muted); font-size: 0.9rem; }

.url-display, .edit-code-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  width: 100%;
}
.url-display span, .edit-code-display code {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
  text-align: left;
}
.edit-code-display .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--sans);
}
.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}
.copy-btn:hover { color: var(--text); background: var(--border); }

.warning {
  font-size: 0.8rem !important;
  color: #e0a04a !important;
  background: rgba(224, 160, 74, 0.1);
  border: 1px solid rgba(224, 160, 74, 0.2);
  border-radius: var(--radius);
  padding: 8px 12px;
  text-align: left;
  width: 100%;
}
.success-modal .modal-actions { width: 100%; justify-content: center; }

/* ─── 404 ────────────────────────────────── */
.not-found { text-align: center; padding: 80px 20px; }
.not-found h1 { font-size: 5rem; font-family: var(--mono); color: var(--accent); }
.not-found p { color: var(--text-muted); margin: 12px 0 28px; }

/* ─── Responsive ─────────────────────────── */
@media (max-width: 600px) {
  header { padding: 14px 16px; }
  .editor-options { grid-template-columns: 1fr; }
  .option-group:first-child { border-right: none; border-bottom: 1px solid var(--border); }
  .home-page main, .view-page main { padding: 20px 14px 60px; }
}

/* ─── Footer ─────────────────────────────── */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--accent); }

/* ─── Info / Start Page ────────────────────── */
.info-page { display: flex; flex-direction: column; gap: 40px; }

.info-section {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.info-number {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(124,106,247,0.25);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
  margin-top: 4px;
  flex-shrink: 0;
}
.info-content h2 { font-size: 1.1rem; margin-bottom: 10px; color: var(--text); }
.info-content p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 8px; }
.info-content a { color: var(--accent); text-decoration: none; }
.info-content a:hover { text-decoration: underline; }
.info-content ul { padding-left: 1.4em; color: var(--text-muted); font-size: 0.92rem; display: flex; flex-direction: column; gap: 6px; }
.info-content li strong { color: var(--text); }
.info-content code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--accent);
}

.code-example {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 12px;
  white-space: pre;
}

.markdown-table { display: flex; flex-direction: column; gap: 0; margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.md-row { display: flex; align-items: center; gap: 20px; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.md-row:last-child { border-bottom: none; }
.md-row:nth-child(even) { background: rgba(255,255,255,0.02); }
.md-row code { min-width: 120px; flex-shrink: 0; }
.md-row span { color: var(--text-muted); }

.info-cta { display: flex; gap: 12px; margin-top: 8px; }

/* ─── Support Page ───────────────────────── */
.support-intro h1 { font-size: 1.8rem; margin-bottom: 8px; }
.support-intro p { color: var(--text-muted); font-size: 0.95rem; }

.contact-form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.contact-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.contact-form-header h2 { font-size: 1rem; }
.contact-mail {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
}
.contact-mail:hover { text-decoration: underline; }

.contact-form { padding: 22px; display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 10px 13px;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-dim); }

.form-error { color: var(--danger); font-size: 0.85rem; font-family: var(--mono); min-height: 16px; }

.contact-success {
  padding: 40px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.contact-success h2 { font-size: 1.2rem; }
.contact-success p { color: var(--text-muted); font-size: 0.9rem; }
.contact-fallback a { color: var(--accent); text-decoration: none; }
.contact-fallback a:hover { text-decoration: underline; }

/* ─── FAQ ────────────────────────────────── */
.faq-section { margin-top: 8px; }
.faq-section h2 { font-size: 1.1rem; margin-bottom: 16px; }
.faq-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }

.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s;
  user-select: none;
}
.faq-q:hover { background: var(--surface2); }
.faq-icon { color: var(--accent); font-size: 1.2rem; font-family: var(--mono); flex-shrink: 0; margin-left: 12px; }

.faq-a {
  display: none;
  padding: 0 18px 15px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-q { background: var(--surface2); }

@media (max-width: 600px) {
  .info-section { flex-direction: column; gap: 12px; }
  .info-cta { flex-direction: column; }
  .site-footer { padding: 14px 16px; }
  .contact-form-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}
