/* ─── Whitespace Remover — Premium Stylesheet ───────────────────────────────
   Scoped entirely to #fu-text-whitespace-remover.
   Uses standard design system variables (--fu-*).
   ─────────────────────────────────────────────────────────────────────────── */

#fu-text-whitespace-remover {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Config Card Styles (Extremely Compact) */
#fu-text-whitespace-remover .fu-wr-config-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem !important;
    width: 100%;
}

/* Presets Row styling */
#fu-text-whitespace-remover .fu-wr-presets-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

#fu-text-whitespace-remover .fu-wr-presets-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fu-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.25rem;
}

#fu-text-whitespace-remover .fu-wr-preset-btn {
    background: transparent;
    border: 1px solid var(--fu-border);
    border-radius: var(--fu-radius);
    padding: 0.2rem 0.5rem;
    font-family: var(--fu-font-family);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fu-text-muted);
    cursor: pointer;
    transition: border-color var(--fu-transition), color var(--fu-transition),
                background var(--fu-transition);
    line-height: 1.2;
}

#fu-text-whitespace-remover .fu-wr-preset-btn:hover {
    border-color: var(--fu-accent);
    color: var(--fu-accent);
    background: var(--fu-accent-light);
}

#fu-text-whitespace-remover .fu-wr-preset-btn.active {
    background-color: var(--fu-accent);
    border-color: var(--fu-accent);
    color: var(--fu-btn-primary-text) !important;
    font-weight: 600;
}

#fu-text-whitespace-remover .fu-wr-input-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#fu-text-whitespace-remover .fu-wr-divider {
    border-top: 1px dashed var(--fu-border);
    margin: 0.15rem 0;
    width: 100%;
}

/* Config settings checkboxes grid (Compact rows) */
#fu-text-whitespace-remover .fu-wr-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 1.75rem;
    width: 100%;
}

#fu-text-whitespace-remover .fu-wr-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

/* Row wrapper for toggles: label text left-aligned, switch right-aligned */
#fu-text-whitespace-remover .fu-wr-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 22px;
}

#fu-text-whitespace-remover .fu-wr-toggle-text {
    font-family: var(--fu-font-family);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fu-text);
    line-height: 1.2;
}

/* Custom CSS iOS Switch Toggle styling */
#fu-text-whitespace-remover .fu-switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 16px;
    flex-shrink: 0;
}

#fu-text-whitespace-remover .fu-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

#fu-text-whitespace-remover .fu-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--fu-border);
    transition: background-color 0.2s ease-in-out;
    border-radius: 16px;
}

#fu-text-whitespace-remover .fu-slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: transform 0.2s ease-in-out;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

#fu-text-whitespace-remover .fu-switch input:checked + .fu-slider {
    background-color: var(--fu-accent);
}

#fu-text-whitespace-remover .fu-switch input:checked + .fu-slider:before {
    transform: translateX(14px);
}

#fu-text-whitespace-remover .fu-switch input:focus-visible + .fu-slider {
    outline: 2px solid var(--fu-accent);
    outline-offset: 2px;
}

/* Disabled styling states */
#fu-text-whitespace-remover .fu-wr-toggle-row.fu-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#fu-text-whitespace-remover .fu-wr-toggle-row.fu-disabled .fu-slider {
    cursor: not-allowed;
}

/* Tab settings input box inline */
#fu-text-whitespace-remover .fu-wr-tab-settings-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

#fu-text-whitespace-remover .fu-wr-tab-size-input {
    width: 38px;
    height: 22px !important;
    padding: 0 0.25rem;
    font-size: 0.75rem;
    text-align: center;
    border: 1px solid var(--fu-border);
    border-radius: var(--fu-radius);
    background: var(--fu-input-bg);
    color: var(--fu-text);
    box-shadow: none;
}

/* Workspace Columns (Symmetrical Side-by-Side) */
#fu-text-whitespace-remover .fu-wr-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    width: 100%;
}

#fu-text-whitespace-remover .fu-wr-input-panel,
#fu-text-whitespace-remover .fu-wr-output-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

/* Base Textarea styling matching Sort/Deduplicate lines */
#fu-text-whitespace-remover .fu-textarea {
    background: var(--fu-input-bg);
    border: 1px solid var(--fu-border);
    border-radius: var(--fu-radius);
    padding: 0.875rem;
    font-family: var(--fu-font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--fu-text);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color var(--fu-transition), box-shadow var(--fu-transition);
    box-sizing: border-box;
    resize: none; /* Disallow manual resizing */
}

/* Symmetrical heights */
#fu-text-whitespace-remover .fu-wr-input-textarea,
#fu-text-whitespace-remover .fu-wr-output-textarea {
    min-height: 280px !important;
    height: 280px !important;
}

#fu-text-whitespace-remover .fu-textarea:focus {
    outline: none;
    border-color: var(--fu-accent);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 3px var(--fu-accent-light);
}

/* Double-layered container for Output/Preview modes */
#fu-text-whitespace-remover .fu-wr-output-container {
    position: relative;
    width: 100%;
    height: 280px;
}

#fu-text-whitespace-remover .fu-wr-output-container .fu-textarea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    min-height: 100% !important;
}

/* Highlighted Preview container */
#fu-text-whitespace-remover #fu-wr-output-preview {
    font-family: monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    background: var(--fu-input-bg);
    border: 1px solid var(--fu-border);
    color: var(--fu-text);
}

/* Visible symbols styling inside preview mode */
#fu-text-whitespace-remover .fu-wr-char-space {
    color: var(--fu-accent);
    opacity: 0.45;
    font-weight: bold;
    user-select: none;
}

#fu-text-whitespace-remover .fu-wr-char-tab {
    color: #ef4444;
    opacity: 0.65;
    font-weight: bold;
    user-select: none;
}

#fu-text-whitespace-remover .fu-wr-char-newline {
    color: var(--fu-text-muted);
    opacity: 0.5;
    font-weight: bold;
    user-select: none;
}

/* Output card headers actions layout */
#fu-text-whitespace-remover .fu-wr-output-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#fu-text-whitespace-remover .fu-wr-visualize-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

/* Stats bar below grid */
#fu-text-whitespace-remover .fu-wr-stats-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fu-text-muted);
    line-height: 1;
}

/* Disabled buttons styling */
#fu-text-whitespace-remover .fu-btn:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

/* Animation */
@keyframes fuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Grid stacking rules */
@media (max-width: 768px) {
    #fu-text-whitespace-remover .fu-wr-checkbox-grid {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }
    #fu-text-whitespace-remover .fu-wr-workspace {
        grid-template-columns: 1fr;
    }
    #fu-text-whitespace-remover .fu-wr-output-container {
        height: 250px;
    }
    #fu-text-whitespace-remover .fu-wr-input-textarea,
    #fu-text-whitespace-remover .fu-wr-output-textarea {
        min-height: 250px !important;
        height: 250px !important;
    }
}
