/* ─── URL Encoder/Decoder - Custom Scoped Stylesheet ──────────────────────
   Scoped entirely to #fu-url-encoder.
   Uses only standard design system variables (--fu-*).
   ─────────────────────────────────────────────────────────────────────────── */

#fu-url-encoder {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

/* Consolidated Control Panel */
#fu-url-encoder .fu-ue-control-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
}

#fu-url-encoder .fu-ue-mode-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--fu-border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.25rem;
}

#fu-url-encoder .fu-ue-mode-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--fu-text);
}

#fu-url-encoder .fu-ue-mode-pills {
    display: flex;
    gap: 0.5rem;
}

#fu-url-encoder .fu-ue-mode-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1.125rem;
    border-radius: 9999px;
    border: 1.5px solid var(--fu-border);
    background: transparent;
    font-family: var(--fu-font-family);
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--fu-text-muted);
    cursor: pointer;
    transition: all var(--fu-transition);
    line-height: 1;
}

#fu-url-encoder .fu-ue-mode-pill:hover {
    border-color: var(--fu-accent);
    color: var(--fu-accent);
    background: var(--fu-accent-light);
}

#fu-url-encoder .fu-ue-mode-pill.active {
    background: var(--fu-accent);
    border-color: var(--fu-accent);
    color: var(--fu-btn-primary-text);
    font-weight: 600;
}

/* Options Grid Layout */
#fu-url-encoder .fu-ue-options-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#fu-url-encoder .fu-ue-flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-end;
}

#fu-url-encoder .fu-ue-field-col {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

#fu-url-encoder .fu-ue-switches-col {
    flex: 2 1 300px;
}

/* Switches */
#fu-url-encoder .fu-ue-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

#fu-url-encoder .fu-ue-switch-container {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}

#fu-url-encoder .fu-ue-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
}

#fu-url-encoder .fu-ue-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

#fu-url-encoder .fu-ue-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--fu-border);
    transition: var(--fu-transition);
    border-radius: 20px;
}

#fu-url-encoder .fu-ue-switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--fu-transition);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

#fu-url-encoder .fu-ue-switch input:checked + .fu-ue-switch-slider {
    background-color: var(--fu-accent);
}

#fu-url-encoder .fu-ue-switch input:focus-visible + .fu-ue-switch-slider {
    box-shadow: 0 0 0 3px var(--fu-accent-light);
}

#fu-url-encoder .fu-ue-switch input:checked + .fu-ue-switch-slider:before {
    transform: translateX(18px);
}

#fu-url-encoder .fu-ue-switch-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fu-text);
}

#fu-url-encoder .fu-ue-switch-label small {
    display: block;
    color: var(--fu-text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    margin-top: 0.125rem;
}

/* Workspace Layout */
#fu-url-encoder .fu-ue-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    width: 100%;
}

#fu-url-encoder .fu-ue-input-panel,
#fu-url-encoder .fu-ue-output-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

/* Textarea Layout Sizing */
#fu-url-encoder .fu-textarea {
    min-height: 280px;
    flex-grow: 1;
    resize: none;
    font-family: var(--fu-font-mono) !important; /* Force monospace style code view */
    font-size: 0.9rem !important;
}

#fu-url-encoder .fu-textarea[readonly] {
    background-color: var(--fu-bg);
    cursor: default;
}

/* Custom Scrollbars */
#fu-url-encoder .fu-textarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#fu-url-encoder .fu-textarea::-webkit-scrollbar-track {
    background: transparent;
}

#fu-url-encoder .fu-textarea::-webkit-scrollbar-thumb {
    background: var(--fu-border);
    border-radius: var(--fu-radius-sm);
}

#fu-url-encoder .fu-textarea::-webkit-scrollbar-thumb:hover {
    background: var(--fu-border-focus);
}

/* Inline Stats */
#fu-url-encoder .fu-ue-panel-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    font-size: 0.775rem;
    color: var(--fu-text-muted);
    font-weight: 500;
}

#fu-url-encoder .fu-ue-dot {
    color: var(--fu-border-focus);
}

/* Responsive Rules */
@media (max-width: 800px) {
    #fu-url-encoder .fu-ue-workspace {
        grid-template-columns: 1fr;
    }
    #fu-url-encoder .fu-textarea {
        min-height: 220px;
    }
}

@media (max-width: 640px) {
    #fu-url-encoder .fu-ue-mode-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    #fu-url-encoder .fu-ue-flex-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    #fu-url-encoder .fu-ue-field-col {
        flex: 1 1 auto;
    }
    #fu-url-encoder .fu-ue-switches {
        flex-direction: column;
        gap: 0.75rem;
    }
}
