/* ═══════════════════════════════════════════════════════════════════════════
   Find and Replace — Tool-Specific Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* Grid layout for the inputs (Find / Replace fields) */
.fu-fr-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.fu-fr-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.fu-field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fu-text-muted);
}

/* Input Wrapper & Badge */
.fu-fr-input-wrapper {
    position: relative;
    width: 100%;
}

.fu-fr-input-wrapper .fu-input {
    padding-right: 80px; /* Leave space for the badge */
}

.fu-fr-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--fu-accent-light);
    color: var(--fu-accent);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    pointer-events: none;
    transition: all var(--fu-transition);
}

.fu-fr-badge.has-matches {
    background: rgba(22, 163, 74, 0.1);
    color: var(--fu-success);
}

/* Options & Actions Layout */
.fu-fr-options-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.fu-fr-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.fu-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--fu-text);
    cursor: pointer;
    user-select: none;
}

.fu-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Header Actions & Title Fixes */
.fu-fr-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fu-panel-title {
    white-space: nowrap;
}

/* Tab Switcher */
.fu-fr-tabs {
    display: inline-flex;
    gap: 2px;
    background: var(--fu-bg);
    padding: 3px;
    border-radius: var(--fu-radius-sm);
    border: 1px solid var(--fu-border);
}

.fu-fr-tab-btn {
    border: none;
    background: transparent;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    color: var(--fu-text-muted);
    transition: all var(--fu-transition);
}

.fu-fr-tab-btn:hover {
    background: transparent !important;
    color: var(--fu-text) !important;
    transform: none !important;
    box-shadow: none !important;
}

.fu-fr-tab-btn.active {
    background: var(--fu-panel-bg) !important;
    color: var(--fu-accent) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.fu-fr-tab-btn.active:hover {
    background: var(--fu-panel-bg) !important;
    color: var(--fu-accent) !important;
    transform: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* Editors layout */
.fu-fr-editors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.fu-fr-editors-grid .fu-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.fu-fr-editors-grid .fu-panel-header {
    min-height: 38px;
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.fu-fr-editors-grid .fu-textarea,
.fu-fr-preview-area {
    flex-grow: 1;
    min-height: 280px;
    font-family: var(--fu-font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    box-sizing: border-box;
}

/* Preview Area */
.fu-fr-preview-area {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: var(--fu-input-bg);
    border: 1px solid var(--fu-border);
    border-radius: var(--fu-radius-sm);
    padding: 0.625rem 0.875rem;
    overflow-y: auto;
    box-sizing: border-box;
}

.fu-fr-preview-area:focus {
    outline: none;
}

/* Match Highlights in Preview */
.fu-fr-highlight {
    background-color: rgba(22, 163, 74, 0.15);
    border-bottom: 2px solid var(--fu-success);
    color: inherit;
    padding: 1px 0;
    border-radius: 2px;
}

/* Error banner */
.fu-fr-error-msg {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--fu-radius-sm);
    color: var(--fu-danger);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Stats layout */
.fu-fr-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.fu-fr-stats .fu-stat {
    padding: 1rem 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .fu-fr-input-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .fu-fr-editors-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .fu-fr-editors-grid .fu-textarea,
    .fu-fr-preview-area {
        min-height: 200px;
    }

    .fu-fr-options-actions-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .fu-fr-options {
        gap: 0.75rem;
    }
}

/* ─── Page Content Resets ────────────────────────────────────────────────── */

/* Force nested unordered lists in post content to match the theme's custom blue bullets */
.entry-content ol ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 1.5rem !important;
    margin-bottom: 1rem !important;
}

.entry-content ol ul li {
    position: relative !important;
    padding-left: 24px !important;
    margin-left: 0 !important;
    margin-bottom: 12px !important;
    list-style: none !important;
    display: block !important;
    line-height: 1.6 !important;
}

.entry-content ol ul li::before {
    content: "•" !important;
    color: var(--fu-accent) !important;
    font-size: 20px !important;
    font-weight: normal !important;
    position: absolute !important;
    left: 6px !important;
    top: -2px !important;
    display: inline-block !important;
}

/* Force inline code blocks in post content to render inline, wrap naturally, and reset left borders */
.entry-content code:not(pre code) {
    display: inline-block !important;
    vertical-align: middle !important;
    padding: 2px 6px !important;
    margin: 0 4px !important;
    border: 1px solid var(--fu-border) !important;
    background: var(--fu-bg) !important;
    color: var(--fu-danger) !important;
    border-radius: var(--fu-radius-sm) !important;
    box-shadow: none !important;
    border-left: 1px solid var(--fu-border) !important; /* Resets block blue border */
    border-left-width: 1px !important;
    border-left-color: var(--fu-border) !important;
    font-size: 0.9rem !important;
}

