/*
 * redirect-generator.css
 * Loaded only by: webdev-tools/redirect-generator.php
 * Purpose: styles the structured "Old URL -> New URL" mapping row input
 * (mapping rows, arrow, row remove buttons and the "Add another redirect"
 * button) and the generated-code output box in the seo-metatag-generator
 * output style. Load order: tool-input.css first, then this file.
 */

.mapping-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
    margin: 14px 0 8px;
    padding: 0;
    list-style: none;
}

.mapping-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.mapping-field {
    flex: 1;
    min-width: 0;
}

.mapping-field .form-control {
    width: 100%;
    height: 46px;
    padding: 8px 14px;
    font-size: 0.98em;
    border: 1px solid #cfd8cf;
    border-radius: 8px;
    background-color: #fdfdfd;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mapping-field .form-control::placeholder {
    color: #9aa79b;
}

.mapping-field .form-control:focus {
    border-color: #237a3a;
    box-shadow: 0 0 0 3px rgba(35, 122, 58, 0.12);
    outline: none;
    background-color: #ffffff;
}

.mapping-row .mapping-old:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.mapping-arrow {
    flex: 0 0 auto;
    align-self: center;
    color: #237a3a;
    font-size: 1.25rem;
}

.mapping-remove {
    flex: 0 0 auto;
    align-self: center;
    border: none;
    background: transparent;
    color: #b02a37;
    cursor: pointer;
    padding: 6px 8px;
    font-size: 1rem;
    line-height: 1;
    border-radius: 6px;
}

.mapping-remove:hover,
.mapping-remove:focus {
    background: #fdecea;
}

.mapping-remove:focus-visible {
    outline: 2px solid #b02a37;
}

.mapping-remove:disabled {
    opacity: 0.25;
    cursor: default;
    background: transparent;
}

.mapping-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 460px;
    margin: 10px auto 0;
    padding: 10px;
    border: 2px dashed #a9c7b0;
    border-radius: 8px;
    background: #f4faf5;
    color: #237a3a;
    font-weight: 600;
    font-size: 0.98em;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.mapping-add:hover,
.mapping-add:focus {
    background: #e9f5ec;
    border-color: #237a3a;
}

.mapping-add:focus-visible {
    outline: 2px solid #237a3a;
}

@media (max-width: 575.98px) {
    .mapping-row {
        gap: 6px;
    }

    .mapping-field .form-control {
        height: 40px;
        padding: 6px 8px;
        font-size: 0.9em;
    }

    .mapping-arrow {
        font-size: 0.95rem;
    }
}

/* ---------------- Live mode ---------------- */

/* Live mode switch sits under the "Load an example" link, centered. */
.rg-live-row {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.rg-live-row .form-check {
    margin-bottom: 0;
}

/* ---------------- Output ---------------- */

/* Generated code box: roomy monospace panel in the style of the
   seo-metatag-generator output — larger padding, rounded block,
   thin scrollbar, and a small corner caption marking the snippet
   format. */
.rg-output-box {
    position: relative;
}

.rg-output-box textarea {
    background: #f9fafb;
    border: 2px solid #eef1f5;
    border-radius: 24px;
    padding: 30px 32px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre;
    overflow-x: auto;
    resize: vertical;
    transition: border-color .2s ease;
}

.rg-output-box textarea:focus {
    border-color: #dfe4ea;
    outline: none;
    box-shadow: none;
}

.rg-output-box textarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.rg-output-box textarea::-webkit-scrollbar-track {
    background: transparent;
}

.rg-output-box textarea::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.rg-output-tag {
    position: absolute;
    right: 18px;
    bottom: 14px;
    font-size: 10px;
    font-weight: 700;
    color: #b8c1cc;
    text-transform: uppercase;
    letter-spacing: .14em;
    pointer-events: none;
}
