/* ── HastePaste — Terminal Theme ─────────────────────── */
:root {
  --bg: #0a0f0a;
  --bg-card: #0d1a0d;
  --bg-input: #080e08;
  --border: #1a3a1a;
  --border-light: #2a4a2a;
  --accent: #7cf7c0;
  --accent-dim: #4ac78a;
  --accent-glow: rgba(124, 247, 192, 0.12);
  --text: #c8e6c8;
  --text-bright: #e8ffe8;
  --text-muted: #5a7a5a;
  --red: #ff6b6b;
  --gold: #ffd700;
  --blue: #6bc5ff;
  --green: #4ae04a;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: var(--mono); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }

/* Scanline */
.scanline { position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(0deg, transparent 0px, transparent 2px, rgba(0,20,0,0.03) 2px, rgba(0,20,0,0.03) 4px); }
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,12,0,0.4) 100%); }

/* ── Header ────────────────────────────────────────── */
.header { background: linear-gradient(180deg, rgba(13,26,13,0.95), rgba(10,15,10,0.95));
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; backdrop-filter: blur(10px); }
.header-inner { max-width: 900px; margin: 0 auto; padding: 0.6rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--accent); font-weight: 700; font-size: 1rem; white-space: nowrap; }
.logo-icon { font-size: 1.3rem; }
.logo-tag { font-size: 0.5rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; background: var(--bg-card); padding: 0.1rem 0.4rem; border-radius: 3px; border: 1px solid var(--border); }
.header-links { display: flex; gap: 0.75rem; font-size: 0.7rem; }
.header-links a { color: var(--text-muted); text-decoration: none; }
.header-links a:hover { color: var(--accent); }
.header-stats { font-size: 0.65rem; color: var(--text-muted); }

/* ── Main ──────────────────────────────────────────── */
.main { max-width: 900px; margin: 0 auto; padding: 1.5rem; min-height: calc(100vh - 120px); }

/* ── Create View ───────────────────────────────────── */
.create-section h2 { font-size: 1rem; color: var(--text-bright); margin-bottom: 0.25rem; }
.create-section h2 .prompt { color: var(--accent); }
.create-section h2 .cursor { animation: blink 1s infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }
.create-desc { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1rem; }

.editor-wrap { position: relative; margin-bottom: 0.75rem; }
.editor { width: 100%; min-height: 200px; max-height: 600px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-bright); font-family: var(--mono); font-size: 0.85rem; padding: 1rem; resize: vertical; outline: none;
  line-height: 1.5; tab-size: 2; transition: border-color 0.2s, height 0.15s ease; overflow-y: auto; }
.editor:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.editor::placeholder { color: var(--text-muted); }
.char-count { position: absolute; bottom: 8px; right: 12px; font-size: 0.6rem; color: var(--text-muted); }

/* Keyboard shortcut hint */
.shortcut-hint { font-size: 0.6rem; color: var(--text-muted); margin-top: 0.25rem; margin-bottom: 0.5rem; opacity: 0.7; }
.shortcut-hint kbd { background: var(--bg-card); border: 1px solid var(--border); border-radius: 3px; padding: 0.05rem 0.35rem; font-family: var(--mono); font-size: 0.58rem; color: var(--text); }

.options-row { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; min-width: 120px; }
.form-group label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select { background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-family: var(--mono); font-size: 0.8rem; padding: 0.5rem 0.6rem; border-radius: 6px; outline: none; }
.form-group input:focus, .form-group select:focus { border-color: var(--accent); }
.form-group select { cursor: pointer; -webkit-appearance: none; appearance: none; }

.checkbox-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.checkbox-row input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.checkbox-row label { font-size: 0.75rem; color: var(--text-muted); cursor: pointer; }

.action-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.turnstile-wrap { flex-shrink: 0; }
.btn-create { background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: var(--bg); border: none;
  padding: 0.65rem 1.8rem; border-radius: 8px; font-family: var(--mono); font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; box-shadow: 0 0 16px var(--accent-glow); }
.btn-create:hover { transform: translateY(-1px); box-shadow: 0 0 24px var(--accent-glow); }
.btn-create:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── View Paste ────────────────────────────────────── */
.view-section { animation: slideIn 0.4s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.paste-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.paste-title { font-size: 1.1rem; color: var(--text-bright); font-weight: 700; }
.paste-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; font-size: 0.65rem; }
.meta-badge { padding: 0.15rem 0.5rem; border-radius: 99px; border: 1px solid var(--border); color: var(--text-muted); }
.meta-badge.lang { color: var(--accent); border-color: var(--accent-dim); }
.meta-badge.views { color: var(--blue); border-color: rgba(107,197,255,0.3); }
.meta-badge.burn { color: var(--red); border-color: rgba(255,107,107,0.3); background: rgba(255,107,107,0.08); }

.code-block { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 1rem;
  overflow-x: auto; margin-bottom: 0.75rem; position: relative; }
.code-block pre { margin: 0; font-family: var(--mono); font-size: 0.82rem; line-height: 1.6; color: var(--text-bright);
  white-space: pre-wrap; word-break: break-word; }
.code-block .line-numbers { position: absolute; left: 0; top: 2.75rem; padding: 0 0.5rem; text-align: right;
  font-size: 0.7rem; color: var(--text-muted); user-select: none; border-right: 1px solid var(--border); min-width: 2.5rem; }
.code-block.has-lines pre { padding-left: 3.5rem; }

/* Language badge on code blocks */
.code-lang-badge { position: absolute; top: 0.4rem; right: 0.6rem; font-size: 0.55rem; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--accent-dim); background: rgba(10, 15, 10, 0.85); border: 1px solid var(--border);
  padding: 0.1rem 0.45rem; border-radius: 4px; pointer-events: none; z-index: 2; }

.paste-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.btn-action { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: 0.4rem 0.75rem;
  border-radius: 6px; font-family: var(--mono); font-size: 0.7rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 0.3rem; }
.btn-action:hover { border-color: var(--accent-dim); color: var(--accent); }
.btn-action.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
.btn-action.primary:hover { background: var(--accent-dim); }

/* Copy feedback state */
.btn-action.copied { background: var(--green); color: var(--bg); border-color: var(--green); font-weight: 600; transition: all 0.15s; }

/* Copy shortcut hint inline */
.copy-shortcut-hint { font-size: 0.55rem; color: var(--text-muted); opacity: 0.6; margin-left: 0.15rem; }

/* Share as image preview */
.share-image-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
  z-index: 500; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.share-image-modal { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px;
  max-width: 700px; width: 100%; max-height: 90vh; overflow: auto; padding: 1.5rem; }
.share-image-modal h3 { color: var(--text-bright); margin-bottom: 0.75rem; font-size: 0.95rem; }
.share-image-modal canvas, .share-image-modal img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); display: block; }
.share-image-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* ── Wget box ──────────────────────────────────────── */
.wget-box { background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.75rem;
  font-size: 0.72rem; color: var(--accent); margin-bottom: 0.75rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.wget-box code { flex: 1; overflow-x: auto; white-space: nowrap; }
.wget-box button { flex-shrink: 0; }

/* ── Recent Pastes ─────────────────────────────────── */
.recent-section { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.recent-section h3 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.recent-list { display: flex; flex-direction: column; gap: 0.35rem; }
.recent-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--text); transition: all 0.2s; font-size: 0.75rem;
  opacity: 0; animation: fadeInUp 0.35s ease forwards; }
.recent-item:hover { border-color: var(--accent-dim); color: var(--accent); }
.recent-item .ri-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .ri-lang { color: var(--accent-dim); font-size: 0.6rem; }
.recent-item .ri-meta { color: var(--text-muted); font-size: 0.6rem; white-space: nowrap; }

/* Staggered fade for recent items */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.recent-item:nth-child(1) { animation-delay: 0.04s; }
.recent-item:nth-child(2) { animation-delay: 0.08s; }
.recent-item:nth-child(3) { animation-delay: 0.12s; }
.recent-item:nth-child(4) { animation-delay: 0.16s; }
.recent-item:nth-child(5) { animation-delay: 0.2s; }
.recent-item:nth-child(6) { animation-delay: 0.24s; }
.recent-item:nth-child(7) { animation-delay: 0.28s; }
.recent-item:nth-child(8) { animation-delay: 0.32s; }
.recent-item:nth-child(9) { animation-delay: 0.36s; }
.recent-item:nth-child(10) { animation-delay: 0.4s; }

/* Empty state for recent pastes */
.recent-empty { font-size: 0.72rem; color: var(--text-muted); padding: 0.75rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 6px; white-space: pre-line; line-height: 1.7; }
.recent-empty .prompt-line { color: var(--accent-dim); }
.recent-empty .output-line { color: var(--text-muted); opacity: 0.7; }

/* ── Loading (terminal style) ──────────────────────── */
.loading { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 3rem; color: var(--accent); font-size: 0.85rem; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.terminal-loading { padding: 3rem 1rem; text-align: center; font-size: 0.85rem; color: var(--accent); }
.terminal-loading .load-text { display: inline; }
.terminal-loading .load-cursor { display: inline-block; animation: blink 0.8s infinite; color: var(--accent); margin-left: 2px; }
.terminal-loading .load-bar { margin-top: 0.5rem; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 1px; }
@keyframes loadBarPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.terminal-loading .load-bar span { animation: loadBarPulse 1.2s ease-in-out infinite; }
.terminal-loading .load-bar span:nth-child(2) { animation-delay: 0.15s; }
.terminal-loading .load-bar span:nth-child(3) { animation-delay: 0.3s; }
.terminal-loading .load-bar span:nth-child(4) { animation-delay: 0.45s; }
.terminal-loading .load-bar span:nth-child(5) { animation-delay: 0.6s; }

/* ── Toast ─────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 10000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { background: var(--bg-card); border: 1px solid var(--accent); color: var(--accent); padding: 0.5rem 1rem;
  border-radius: 8px; font-family: var(--mono); font-size: 0.75rem; animation: toastIn 0.3s ease, toastOut 0.3s ease 3s forwards;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.toast.error { border-color: var(--red); color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ── Mode Tabs ─────────────────────────────────────── */
.mode-tabs { display: flex; gap: 0; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.mode-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted);
  font-family: var(--mono); font-size: 0.8rem; padding: 0.5rem 1rem; cursor: pointer; transition: all 0.2s; }
.mode-tab:hover { color: var(--text); }
.mode-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Drop Zone ─────────────────────────────────────── */
.drop-zone { border: 2px dashed var(--border); border-radius: 8px; padding: 3rem 1.5rem; text-align: center;
  cursor: pointer; transition: all 0.2s; background: var(--bg-input); }
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: var(--accent-glow); }
.drop-icon { font-size: 2rem; margin-bottom: 0.5rem; color: var(--accent-dim); }
.drop-zone-text { color: var(--text-muted); font-size: 0.8rem; }
.drop-hint { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ── Image Preview ─────────────────────────────────── */
.image-preview { max-width: 100%; max-height: 400px; border-radius: 8px; border: 1px solid var(--border); display: block; margin: 0 auto; }
.image-preview-info { text-align: center; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ── Image View ────────────────────────────────────── */
.image-view-block { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  padding: 1rem; margin-bottom: 0.75rem; text-align: center; }
.image-full { max-width: 100%; max-height: 600px; border-radius: 4px; }

/* ── Admin Controls ────────────────────────────────── */
.admin-btn { border-color: #662222 !important; color: #ff6b6b !important; }
.admin-btn:hover { background: rgba(255,107,107,0.1) !important; border-color: #ff6b6b !important; }
.admin-delete-inline { color: var(--text-muted); cursor: pointer; font-size: 0.65rem; padding: 0.2rem 0.4rem;
  border-radius: 3px; transition: all 0.2s; flex-shrink: 0; margin-left: auto; }
.admin-delete-inline:hover { color: #ff6b6b; background: rgba(255,107,107,0.1); }

/* ── Footer ────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); text-align: center; padding: 1.5rem; font-size: 0.65rem; color: var(--text-muted); }
.footer a { color: var(--accent-dim); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer-ecosystem { display: block; margin-top: 0.35rem; font-size: 0.58rem; opacity: 0.6; }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Duplicate Warning ─────────────────────────────── */
.duplicate-warning { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.75rem; margin-bottom: 0.75rem;
  background: rgba(255, 215, 0, 0.06); border: 1px solid rgba(255, 215, 0, 0.25); border-radius: 6px;
  font-size: 0.7rem; color: var(--gold); animation: fadeInUp 0.3s ease; }
.duplicate-warning a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.duplicate-warning a:hover { color: var(--text-bright); }

/* ── Line Wrap Toggle ──────────────────────────────── */
.code-block-header { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem;
  padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--border); margin: -1rem -1rem 0.75rem -1rem;
  background: rgba(13, 26, 13, 0.5); border-radius: 8px 8px 0 0; }
.btn-wrap-toggle { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 0.15rem 0.5rem;
  border-radius: 4px; font-family: var(--mono); font-size: 0.55rem; cursor: pointer; transition: all 0.2s; }
.btn-wrap-toggle:hover { border-color: var(--accent-dim); color: var(--accent); }
.btn-wrap-toggle.active { border-color: var(--accent-dim); color: var(--accent); background: var(--accent-glow); }
.code-block.nowrap pre { white-space: pre; word-break: normal; }
.code-block-header .code-lang-badge { position: static; pointer-events: auto; margin-right: auto; }

/* ── Raw View Link ─────────────────────────────────── */
.raw-link { font-size: 0.65rem; color: var(--text-muted); text-decoration: none; margin-left: auto; }
.raw-link:hover { color: var(--accent); }

/* ── Keyboard Shortcuts Overlay ────────────────────── */
.shortcuts-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(6px);
  z-index: 600; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fadeInUp 0.2s ease; }
.shortcuts-modal { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px;
  max-width: 440px; width: 100%; padding: 1.5rem; }
.shortcuts-modal h3 { color: var(--accent); font-size: 0.95rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.shortcuts-list { list-style: none; padding: 0; }
.shortcuts-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0;
  border-bottom: 1px solid var(--border); font-size: 0.75rem; color: var(--text); }
.shortcuts-list li:last-child { border-bottom: none; }
.shortcuts-list kbd { background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px;
  padding: 0.15rem 0.45rem; font-family: var(--mono); font-size: 0.65rem; color: var(--accent); }
.shortcuts-close { display: block; margin-top: 1rem; text-align: center; font-size: 0.65rem; color: var(--text-muted); }
.shortcuts-close kbd { background: var(--bg-input); border: 1px solid var(--border); border-radius: 3px;
  padding: 0.1rem 0.35rem; font-family: var(--mono); font-size: 0.6rem; color: var(--text); }

/* ── Code Block Fade-In ────────────────────────────── */
.code-block { opacity: 0; animation: codeFadeIn 0.5s ease forwards 0.15s; }
@keyframes codeFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── 404 Page ──────────────────────────────────────── */
.not-found { text-align: center; padding: 3rem 1rem; animation: slideIn 0.4s ease-out; }
.not-found-ascii { font-size: 0.55rem; line-height: 1.15; color: var(--accent-dim); margin-bottom: 1.5rem; white-space: pre; display: inline-block; text-align: left; }
.not-found-terminal { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem;
  text-align: left; font-size: 0.8rem; max-width: 480px; margin: 0 auto 1.5rem; line-height: 1.8; }
.not-found-terminal .prompt { color: var(--accent); }
.not-found-terminal .err { color: var(--red); }
.not-found-terminal .cursor { animation: blink 1s infinite; color: var(--accent); }

/* ── Size Visualization Bar ────────────────────────── */
.size-bar-wrap { display: inline-flex; align-items: center; gap: 0.35rem; }
.size-bar { width: 40px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
.size-bar-fill { height: 100%; background: var(--accent-dim); border-radius: 3px; transition: width 0.3s; min-width: 1px; }
.size-bar-fill.warn { background: var(--gold); }
.size-bar-fill.danger { background: var(--red); }

/* ── Expiry Warning ────────────────────────────────── */
.meta-badge.expiry-warn { color: var(--gold); border-color: rgba(255, 215, 0, 0.35); background: rgba(255, 215, 0, 0.08);
  animation: expiryPulse 2s ease-in-out infinite; }
@keyframes expiryPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* ── Mobile ────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner { padding: 0.5rem 0.75rem; }
  .logo-tag { display: none; }
  .header-links { display: none; }
  .main { padding: 1rem 0.75rem; }
  .editor { min-height: 200px; font-size: 0.82rem; }
  .options-row { flex-direction: column; gap: 0.5rem; }
  .form-group { min-width: 0; }
  .form-group input, .form-group select { font-size: 1rem; } /* prevent iOS zoom */
  .action-row { flex-direction: column; }
  .btn-create { width: 100%; text-align: center; }
  .paste-header { flex-direction: column; }
  .paste-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
  .btn-action { justify-content: center; min-width: 0; }
  .wget-box { flex-direction: column; gap: 0.35rem; }
  .wget-box button { width: 100%; }
  .share-image-modal { margin: 0.5rem; padding: 1rem; }
  body::after { background: radial-gradient(ellipse at center, transparent 60%, rgba(0,12,0,0.3) 100%); }
}
