/* CodeMint – Code Formatter | privotools.com/code-formatter/ */
/* Accent: #10b981 (emerald) | mobile-first, responsive */

:root {
  --accent:       #10b981;
  --accent-hover: #34d399;
  --accent-dim:   rgba(16, 185, 129, 0.12);
  --bg:           #0f0f12;
  --surface:      #1a1a1f;
  --surface-2:    #14141a;
  --border:       #2d2d35;
  --text:         #e8e8ec;
  --text-muted:   #9a9aa3;
  --error:        #f87171;
  --radius:       12px;
  --mono: ui-monospace, 'Cascadia Code', 'Fira Code', 'JetBrains Mono',
          'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; }

/* ── Container ───────────────────────────────────────────────────────────── */
.container {
  width: min(100% - 2rem, 1080px);
  margin: 0 auto;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #121218;
  border-bottom: 1px solid var(--border);
}
.site-nav-inner {
  min-height: 48px;
  max-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.wordmark {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text);
}
.wordmark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}


/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  padding: 1.5rem 1rem;
  text-align: center;
}
.title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.title-accent { color: var(--accent); }
.tagline {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Main wrapper ────────────────────────────────────────────────────────── */
.main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
}

/* ── Ad slot ─────────────────────────────────────────────────────────────── */
.ad-slot {
  width: 100%;
  min-height: 90px;
  margin: 0 0 1.25rem;
}

/* ── Language tabs ───────────────────────────────────────────────────────── */
.lang-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.lang-btn {
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--mono);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.lang-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.lang-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Options bar ─────────────────────────────────────────────────────────── */
.options-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.options-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.indent-group {
  display: flex;
  gap: 0.25rem;
}
.indent-btn {
  padding: 0.3rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.indent-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.indent-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--text);
}

.actions-right {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #052e1c;
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #052e1c;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.shortcut {
  font-size: 0.75rem;
  opacity: 0.7;
  font-weight: 400;
}

/* ── Editor grid ─────────────────────────────────────────────────────────── */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .editor-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Editor panels ───────────────────────────────────────────────────────── */
.editor-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.panel-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
/* ── Editor textareas ────────────────────────────────────────────────────── */
.editor-textarea {
  width: 100%;
  min-height: 340px;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.65;
  resize: vertical;
  tab-size: 2;
  transition: border-color 0.15s;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.editor-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.editor-textarea[readonly] {
  background: var(--surface);
  cursor: default;
  color: var(--text);
}
.editor-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}
.editor-textarea.has-error {
  border-color: var(--error);
}

/* ── Error message ───────────────────────────────────────────────────────── */
.error-msg {
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  color: var(--error);
  font-size: 0.85rem;
  font-family: var(--mono);
  line-height: 1.4;
}
.error-msg.visible { display: flex; }

/* ── Copy success feedback ───────────────────────────────────────────────── */
.copy-feedback {
  font-size: 0.82rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  align-self: center;
}
.copy-feedback.show { opacity: 1; }

/* ── How to Use guide ────────────────────────────────────────────────────── */
.guide-section {
  margin: 1.5rem 0 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.guide-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.guide-steps {
  margin: 0;
  padding-left: 1.35rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.guide-steps li strong { color: var(--text); }

/* ── About / SEO section ─────────────────────────────────────────────────── */
#about {
  margin-top: 3rem;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border);
}
#about h2 {
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  margin: 0 0 0.75rem;
}
#about h3 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}
#about p {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
#about ul {
  padding-left: 1.35rem;
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
#about li { margin-bottom: 0.4rem; }
#about strong { color: var(--text); }
#about code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}

/* ── FAQ ─────────────────────────────────────────────────────────────────── */
.faq-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.faq-item {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}
.faq-item:last-child {
  border-bottom: 1px solid var(--border);
}
.faq-item h3 {
  margin: 0 0 0.4rem !important;
  font-size: 0.97rem !important;
  font-weight: 600;
  color: var(--text) !important;
}
.faq-item p {
  margin: 0 !important;
  font-size: 0.9rem !important;
  color: var(--text-muted) !important;
}

/* ── Languages table ─────────────────────────────────────────────────────── */
.lang-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}
.lang-table th {
  text-align: left;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}
.lang-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}
.lang-table td:first-child {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  white-space: nowrap;
}

/* ── Related tools ───────────────────────────────────────────────────────── */
.related-tools {
  max-width: 1080px;
  margin: 3rem auto 0;
  padding: 0 1rem 2.5rem;
}
.related-tools h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}
.related-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.related-tool-card:hover { border-color: var(--accent); }
.related-tool-card .tool-icon { font-size: 1.25rem; margin-bottom: 0.2rem; }
.related-tool-card strong { font-size: 0.95rem; }
.related-tool-card span:last-child { font-size: 0.82rem; color: var(--text-muted); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}
.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; }
.footer-copy { margin: 0; text-align: center; }

/* ── Responsive tweaks ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .actions-right { margin-left: 0; width: 100%; }
  .btn-primary { flex: 1; justify-content: center; }
  .editor-textarea { min-height: 240px; font-size: 0.82rem; }
  .shortcut { display: none; }
}

/* ── unified nav links ── */
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link { font-size: 0.85rem; color: var(--text-dim); text-decoration: none; padding: 0.3rem 0.6rem; border-radius: 6px; transition: color 0.15s, background 0.15s; white-space: nowrap; }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.site-nav { position: sticky; top: 0; z-index: 100; }
@media (max-width: 420px) { .nav-link { font-size: 0.78rem; padding: 0.25rem 0.45rem; } }
