/* Toolbox101 — styles
   Design system: rban.dev brand. Near-black monochrome, hairline borders,
   JetBrains Mono UI, serif-italic display, single emerald accent.
   Dark-only. No glass, no glow, no gradients. */

:root {
    --bg: #0A0A0A;
    --surface: #111111;
    --surface-deep: #0E0E0E;
    --border: #1E1E1E;
    --border-strong: #262626;
    --border-hover: #383838;
    --text: #E5E5E5;
    --text-muted: #A3A3A3;
    --text-dim: #808080;   /* ≥4.5:1 on --bg for AA at small sizes */
    --text-faint: #525252;
    --accent: #34d399;      /* emerald-400 */
    --accent-dim: #059669;  /* emerald-600 */
    --danger: #f87171;      /* red-400 */
}

/* ---------- Base ---------- */

html {
    scrollbar-color: #262626 transparent;
    scrollbar-width: thin;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.font-display {
    font-family: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
    font-style: italic;
}

/* Custom scrollbar (WebKit) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #262626; }
::-webkit-scrollbar-thumb:hover { background: #333333; }

::selection { background: #404040; color: #ffffff; }

/* ---------- Focus ---------- */

:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 1px;
}

/* ---------- Header ---------- */

.site-header {
    box-sizing: border-box;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.search-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border-radius: 2px;
    transition: border-color 0.2s ease-out;
}

.search-input::placeholder { color: var(--text-faint); }

.search-input:focus {
    outline: none;
    border-color: var(--accent-dim);
}

/* ---------- Sidebar navigation ---------- */

.nav-category {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.5rem 0.4rem 0.75rem;
    border-left: 2px solid transparent;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: background-color 0.15s ease-out, color 0.15s ease-out;
    cursor: pointer;
}

.nav-item:hover {
    background: #121212;
    color: var(--text);
}

.nav-item.active {
    background: #121212;
    border-left-color: var(--accent);
    color: var(--accent);
}

.nav-item i {
    flex-shrink: 0;
}

/* ---------- Tool UI ---------- */

.tool-card {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.5rem;
}

.field-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.input-area {
    width: 100%;
    background: var(--surface-deep);
    border: 1px solid var(--border-strong);
    border-radius: 0;
    padding: 0.75rem;
    color: var(--text);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    transition: border-color 0.2s ease-out;
}

.input-area::placeholder { color: var(--text-faint); }

.input-area:focus {
    outline: none;
    border-color: var(--accent-dim);
}

.option-input {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    color: var(--text);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    width: 5rem;
    transition: border-color 0.2s ease-out;
}

.option-input:focus {
    outline: none;
    border-color: var(--accent-dim);
}

.option-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

.output-area {
    width: 100%;
    min-height: 4rem;
    background: var(--surface-deep);
    border: 1px solid var(--border-strong);
    border-radius: 0;
    padding: 0.75rem;
    color: var(--text);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Empty-state placeholder when an output has no content */
.output-area:empty::before {
    content: "Output appears here";
    color: var(--text-faint);
}

.output-area.output-error {
    color: var(--danger);
    border-color: #3f1d1d;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.25rem;
    padding: 0 1rem;
    background: #141414;
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    color: #D4D4D4;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}

.btn:hover {
    background: #1C1C1C;
    border-color: var(--border-hover);
    color: #ffffff;
}

.btn-accent {
    color: var(--accent);
    border-color: #1f4d3d;
    background: transparent;
}

.btn-accent:hover {
    background: rgba(52, 211, 153, 0.06);
    border-color: var(--accent-dim);
    color: #6ee7b7;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    color: var(--text-dim);
    cursor: pointer;
    transition: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}

.btn-icon:hover {
    background: #121212;
    border-color: var(--border-strong);
    color: var(--text);
}

/* Diff highlighting */

.diff-added {
    background: rgba(52, 211, 153, 0.10);
    color: #6ee7b7;
}

.diff-removed {
    background: rgba(248, 113, 113, 0.10);
    color: #fca5a5;
    text-decoration: line-through;
}

.diff-unchanged {
    color: var(--text-muted);
}

/* Coming-soon placeholder for unimplemented tools */

.placeholder-card {
    border: 1px dashed var(--border-strong);
    padding: 1.25rem;
    color: var(--text-dim);
    font-size: 0.75rem;
    line-height: 1.7;
}

/* Toast */

#toast {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    color: var(--text);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* QR output centering */

.qr-wrap {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.qr-wrap canvas,
.qr-wrap img {
    display: block;
}

/* ---------- Motion ---------- */

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

.animate-fade-in {
    animation: fadeIn 0.25s ease-out forwards;
}

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