/* ════════════════════════════════════════════════════════════════════════════
   RECATOOLS — Find and Replace — style.css
   Tool-specific overrides only.
   Base styles live in /assets/css/tool-page.css.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Tool card layout ────────────────────────────────────────────────────── */
.far-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Input textarea ───────────────────────────────────────────────────────── */
.far-textarea {
    width: 100%;
    min-height: 160px;
    padding: 0.875rem 1rem;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text, #0D1B2A);
    background: var(--bg, #FFFFFF);
    border: 1px solid var(--border, #E2E4E8);
    border-radius: 10px;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.18s;
}
.far-textarea:focus {
    outline: none;
    border-color: var(--accent, #E8472F);
    box-shadow: 0 0 0 3px rgba(232,98,42,0.10);
}
.far-textarea::placeholder {
    color: var(--muted, #64748B);
    opacity: 0.75;
}

/* ── Find / Replace row ───────────────────────────────────────────────────── */
.far-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
    align-items: start;
}
@media (max-width: 600px) {
    .far-fields-row {
        grid-template-columns: 1fr;
    }
}

.far-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.far-field-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted, #64748B);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.far-input {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--text, #0D1B2A);
    background: #fff;
    border: 1px solid var(--border, #E2E4E8);
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.18s;
}
.far-input:focus {
    outline: none;
    border-color: var(--accent, #E8472F);
    box-shadow: 0 0 0 3px rgba(232,98,42,0.10);
}
.far-input::placeholder {
    color: var(--muted, #64748B);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.875rem;
    opacity: 0.75;
}

/* ── Options row (under Find field) ─────────────────────────────────────── */
.far-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.25rem;
}

.far-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    user-select: none;
}
.far-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent, #E8472F);
    cursor: pointer;
    flex-shrink: 0;
}
.far-option-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text, #0D1B2A);
    white-space: nowrap;
}

/* ── Match counter badge ─────────────────────────────────────────────────── */
.match-counter {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.625rem;
    border-radius: 999px;
    border: 1px solid transparent;
    min-height: 1.5rem;
    transition: background 0.15s, color 0.15s;
}
.match-counter:empty {
    display: none;
}
.match-counter--found {
    background: rgba(232,98,42,0.10);
    border-color: rgba(232,98,42,0.25);
    color: var(--accent, #E8472F);
}
.match-counter--none {
    background: rgba(107,103,96,0.08);
    border-color: rgba(107,103,96,0.2);
    color: var(--muted, #64748B);
}
.match-counter--error {
    background: rgba(220,38,38,0.08);
    border-color: rgba(220,38,38,0.2);
    color: #dc2626;
}

/* ── Action buttons row ──────────────────────────────────────────────────── */
.far-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
}

/* ── Regex panel ─────────────────────────────────────────────────────────── */
.regex-panel {
    background: #FFFFFF;
    border: 1px solid var(--border, #E2E4E8);
    border-radius: 10px;
    padding: 0.875rem 1rem;
}
.regex-panel-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--muted, #64748B);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.regex-cheatsheet {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1.125rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.regex-cheatsheet li {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    font-size: 0.8125rem;
}
.regex-cheatsheet code {
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent, #E8472F);
    background: rgba(232,98,42,0.08);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
}
.regex-cheatsheet span {
    color: var(--muted, #64748B);
}

/* ── Regex error ─────────────────────────────────────────────────────────── */
.regex-error {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(220,38,38,0.07);
    border: 1px solid rgba(220,38,38,0.2);
    border-radius: 7px;
    font-size: 0.8125rem;
    color: #dc2626;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
}

/* ── Output section ──────────────────────────────────────────────────────── */
.far-output-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.far-output-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted, #64748B);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.far-textarea--output {
    background: #fff;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: 0.875rem;
    min-height: 140px;
    cursor: default;
    color: var(--text, #0D1B2A);
}
.far-textarea--output:focus {
    border-color: var(--border, #E2E4E8);
    box-shadow: none;
}

/* ── Highlight output div ────────────────────────────────────────────────── */
.far-highlight-output {
    width: 100%;
    min-height: 140px;
    padding: 0.875rem 1rem;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text, #0D1B2A);
    background: #fff;
    border: 1px solid var(--border, #E2E4E8);
    border-radius: 10px;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    max-height: 320px;
}
.far-highlight-output mark {
    background: rgba(232,98,42,0.25);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Stats line ──────────────────────────────────────────────────────────── */
.far-stats {
    font-size: 0.8125rem;
    color: var(--muted, #64748B);
    font-style: italic;
    padding: 0.25rem 0;
}

/* ── Copy / Download buttons ─────────────────────────────────────────────── */
.far-output-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── History panel ───────────────────────────────────────────────────────── */
.history-section {
    border: 1px solid var(--border, #E2E4E8);
    border-radius: 10px;
    overflow: hidden;
}
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: #faf9f7;
    border: none;
    width: 100%;
    text-align: left;
    font-family: 'IBM Plex Sans', sans-serif;
    transition: background 0.15s;
}
.history-header:hover {
    background: #f3f1ee;
}
.history-header-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text, #0D1B2A);
}
.history-toggle-icon {
    font-size: 1rem;
    color: var(--muted, #64748B);
    font-weight: 700;
    line-height: 1;
    width: 20px;
    text-align: center;
}
.history-body {
    padding: 0.75rem 1rem;
    background: #fff;
    border-top: 1px solid var(--border, #E2E4E8);
}
.history-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.history-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3125rem 0.75rem;
    background: #FFFFFF;
    border: 1px solid var(--border, #E2E4E8);
    border-radius: 999px;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: 0.78rem;
    color: var(--text, #0D1B2A);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-pill:hover {
    background: rgba(232,98,42,0.08);
    border-color: rgba(232,98,42,0.30);
    color: var(--accent, #E8472F);
}
.history-find {
    color: var(--accent, #E8472F);
    font-weight: 700;
}
.history-arrow {
    color: var(--muted, #64748B);
    font-family: 'IBM Plex Sans', sans-serif;
}
.history-replace {
    color: #16a34a;
}
.history-empty {
    font-size: 0.8125rem;
    color: var(--muted, #64748B);
    font-style: italic;
}

/* ── Section divider ─────────────────────────────────────────────────────── */
.far-divider {
    border: none;
    border-top: 1px solid var(--border, #E2E4E8);
    margin: 0.25rem 0;
}

/* ── Responsive: stack on mobile ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .far-actions {
        flex-direction: column;
    }
    .far-actions .btn-primary,
    .far-actions .btn-ghost {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .far-output-actions {
        flex-direction: column;
    }
    .far-output-actions button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* cache-buster: 2026-05-24T05:06:05Z */
