/* === json-finder/style.css — synced with SmartiTools dark theme === */

/* ── Layout ─────────────────────────────────────────────────────── */
.jf-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ── Header ─────────────────────────────────────────────────────── */
.jf-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
}

.jf-info-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.jf-info-btn:hover { border-color: var(--brand-cyan); color: var(--brand-cyan); }

.jf-subtitle {
    color: var(--text-muted);
    margin: 0 0 1.75rem 0;
    font-size: 0.95rem;
}

/* ── Path section ────────────────────────────────────────────────── */
.jf-path-section { margin-bottom: 1.25rem; }

.jf-path-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.jf-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.jf-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 0.25rem;
}

.jf-path-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.jf-path-input {
    flex: 1;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s;
    outline: none;
}
.jf-path-input:focus { border-color: var(--brand-cyan); }

.jf-copy-btn {
    background: var(--brand-blue);
    color: #fff;
    border: 1.5px solid var(--brand-blue);
    padding: 0.65rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: inherit;
}
.jf-copy-btn:hover { background: #1d4ed8; border-color: #1d4ed8; }
.jf-copy-btn-success { background: #16a34a !important; border-color: #16a34a !important; }

/* ── Two-column grid ─────────────────────────────────────────────── */
.jf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 768px) { .jf-grid { grid-template-columns: 1fr; } }

.jf-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.jf-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.jf-icon-purple { color: var(--brand-cyan); }
.jf-icon-teal   { color: var(--brand-cyan); }

/* ── Textarea ────────────────────────────────────────────────────── */
.jf-textarea {
    width: 100%;
    resize: none;
    height: 400px;
    font-family: 'Courier New', monospace;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem 0.9rem 0.9rem 4rem;
    tab-size: 2;
    font-size: 0.82rem;
    transition: border-color 0.2s;
    outline: none;
    box-sizing: border-box;
}
.jf-textarea:focus { border-color: var(--brand-cyan); }

/* ── Error ───────────────────────────────────────────────────────── */
.jf-error {
    color: #fca5a5;
    font-size: 0.82rem;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    font-family: 'Courier New', monospace;
}

/* ── Button row ──────────────────────────────────────────────────── */
.jf-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.jf-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1.1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text);
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}
.jf-btn:hover { border-color: var(--brand-cyan); color: var(--brand-cyan); }

.jf-btn-blue  { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.jf-btn-blue:hover  { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.jf-btn-purple { border-color: var(--brand-cyan); color: var(--brand-cyan); }
.jf-btn-purple:hover { background: rgba(34,211,238,0.1); }
.jf-btn-red   { border-color: #ef4444; color: #ef4444; }
.jf-btn-red:hover   { background: rgba(239,68,68,0.1); }

/* ── Search ──────────────────────────────────────────────────────── */
.jf-search-wrap { position: relative; }

.jf-search {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.2s;
    outline: none;
}
.jf-search:focus { border-color: var(--brand-cyan); }

.jf-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.8rem;
}

/* ── Tree container ──────────────────────────────────────────────── */
.jf-tree-container {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    height: 400px;
    overflow: auto;
    padding: 0.9rem;
    position: relative;
}

/* ── Modal ───────────────────────────────────────────────────────── */
.jf-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-heading);
}

.jf-instructions {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text);
    font-size: 0.85rem;
}

.jf-shortcuts {
    background: var(--bg);
    border-radius: 8px;
    padding: 0.85rem;
    border: 1px solid var(--border);
}

.jf-shortcuts-title {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.jf-shortcut-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.82rem;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* ── JSON Input container internals ──────────────────────────────── */
.json-input-container { position: relative; }

#lineNumbers {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3rem;
    background: rgba(255,255,255,0.02);
    color: var(--text-muted);
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    overflow: hidden;
    border-right: 1px solid var(--border);
    border-radius: 10px 0 0 10px;
    padding-right: 0.5rem;
    z-index: 10;
    line-height: 1.6;
    padding-top: 0.9rem;
}

#errorMarkers {
    position: absolute;
    left: 3rem; top: 0; bottom: 0;
    width: 1.5rem;
    z-index: 15;
    pointer-events: none;
}

#bracketMatch {
    position: absolute;
    z-index: 5;
    border-radius: 2px;
    display: none;
}

/* ── JSON Tree styles ────────────────────────────────────────────── */
.json-tree       { padding-left: 1.25rem; line-height: 1.6; }
.json-node       { cursor: pointer; user-select: none; position: relative; }
.clickable-wrapper {
    display: flex; align-items: center;
    padding: 2px 0; border-radius: 4px;
    transition: background-color 0.15s;
}
.clickable-wrapper:hover { background: rgba(34,211,238,0.07); }

.json-key     { color: #93c5fd; font-weight: 600; }
.json-value   { color: #86efac; }
.json-string  { color: #fbbf24; }
.json-number  { color: #67e8f9; }
.json-boolean { color: #fb923c; }
.json-null    { color: var(--text-muted); }

.json-toggle {
    display: inline-block;
    width: 1rem;
    text-align: center;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.collapsible-content          { display: none; }
.collapsible-content.expanded { display: block; }

.selected {
    background-color: rgba(34, 211, 238, 0.12);
    border-radius: 4px;
}

.json-count {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 0.4rem;
}

/* ── Utility ─────────────────────────────────────────────────────── */
.hidden            { display: none !important; }
.hidden-by-search  { display: none !important; }

/* ── Path format selector ────────────────────────────────────────── */
.path-format-selector {
    display: flex; align-items: center;
    gap: 0.25rem; flex-wrap: wrap;
}

.format-option {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    transition: all 0.2s;
}
.format-option.active             { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
.format-option:hover:not(.active) { border-color: var(--brand-cyan); color: var(--brand-cyan); }

/* ── Shortcut keys ───────────────────────────────────────────────── */
.shortcut-key {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--text);
}

/* ── Modal overlay ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 12px;
    max-width: 560px;
    width: 92%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
    position: relative;
    color: var(--text);
    border: 1px solid var(--border);
}

.modal-close-btn {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
}
.modal-close-btn:hover { border-color: #ef4444; color: #ef4444; }

/* ── Error markers ───────────────────────────────────────────────── */
.error-marker {
    position: absolute;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    pointer-events: auto;
    z-index: 20;
    transition: all 0.2s;
}
.error-marker:hover { transform: scale(1.2); }
.error-marker:hover::after {
    content: attr(data-error);
    position: fixed;
    background: #1e293b;
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-left: 6px;
}

/* ── Highlights ──────────────────────────────────────────────────── */
.bracket-highlight {
    position: absolute;
    background-color: rgba(34, 211, 238, 0.2);
    border-radius: 2px;
    z-index: 5;
}

.bracket-line {
    position: absolute;
    left: 3.2rem;
    width: 2px;
    background-color: var(--brand-cyan);
    z-index: 4;
}

.char-highlight      { background-color: rgba(34, 211, 238, 0.2); }
.path-container-focused { box-shadow: 0 0 0 2px rgba(34,211,238,0.25); }
.error-line          { background-color: rgba(239, 68, 68, 0.08); }

/* ── Loading overlay ─────────────────────────────────────────────── */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    z-index: 10;
}

.line-number {
    padding: 0 0.25rem;
    line-height: 1.6;
}
