/* End-to-End Test Generator – mobile-first */

/* ----- Workspace ----- */
.e2e-workspace {
    margin-bottom: 2rem;
}

.e2e-builder {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ----- Config rail ----- */
.e2e-config {
    background: var(--surface-color, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.e2e-config-inner {
    padding: 1.25rem 1rem;
}

.e2e-field {
    margin-bottom: 1.125rem;
}

.e2e-field:last-of-type {
    margin-bottom: 0;
}

.e2e-field__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.e2e-field__control {
    width: 100%;
    max-width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--text-primary, #111827);
    background: var(--input-bg, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.e2e-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

.e2e-input {
    background-image: none;
    padding-right: 0.875rem;
}

.e2e-select:focus,
.e2e-input:focus {
    outline: none;
    border-color: var(--focus-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.e2e-field--chips {
    margin-top: 1rem;
}

.e2e-field--chips .e2e-field__label {
    margin-bottom: 0.5rem;
}

.e2e-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.e2e-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary, #4b5563);
    background: var(--chip-bg, #f3f4f6);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.e2e-tag:hover {
    background: var(--chip-hover, #e5e7eb);
}

.e2e-tag__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.e2e-tag:has(.e2e-tag__input:checked) {
    color: var(--chip-active-color, #1d4ed8);
    background: var(--chip-active-bg, #dbeafe);
    border-color: var(--focus-color, #3b82f6);
}

.e2e-config__actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.e2e-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.e2e-cta:hover {
    opacity: 0.95;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.e2e-cta:active {
    transform: scale(0.99);
}

.e2e-cta:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.e2e-cta__icon {
    width: 1.125rem;
    height: 1.125rem;
    background: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83'/%3E%3C/svg%3E");
}

/* ----- Preview pane ----- */
.e2e-preview {
    background: var(--surface-color, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.e2e-preview__inner {
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.e2e-preview__head {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--input-bg, #f9fafb);
}

.e2e-preview__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.e2e-preview__body {
    position: relative;
    flex: 1;
    min-height: 280px;
}

.e2e-preview__editor {
    width: 100%;
    min-height: 280px;
    border: none;
    border-radius: 0;
    background: var(--editor-bg, #1e1e2e);
}

.e2e-preview__empty {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
    text-align: center;
    pointer-events: none;
}

.e2e-preview__empty[aria-hidden="true"] {
    display: none;
}

.e2e-preview__empty-icon {
    width: 48px;
    height: 48px;
    background: var(--text-muted);
    opacity: 0.35;
    border-radius: 12px;
    mask-size: 24px;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E");
}

.e2e-preview__footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    background: var(--input-bg, #f9fafb);
    align-items: center;
}

.e2e-preview__footer[hidden] {
    display: none;
}

.e2e-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary, #111827);
    background: var(--surface-color, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.e2e-action:hover {
    background: var(--chip-hover, #f3f4f6);
    border-color: var(--text-muted, #9ca3af);
}

.e2e-action__icon {
    display: block;
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* ----- Guide ----- */
.e2e-guide {
    margin-bottom: 2rem;
    padding: 1.5rem 1.25rem;
    background: var(--surface-color, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.e2e-guide__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--text-primary, #111827);
}

.e2e-guide__h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: var(--text-primary, #111827);
}

.e2e-guide__p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary, #4b5563);
    margin: 0 0 0.5rem;
}

.e2e-guide__list {
    margin: 0 0 0.5rem;
    padding-left: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary, #4b5563);
}

.e2e-guide__list li {
    margin-bottom: 0.35rem;
}

.e2e-guide__list code {
    font-size: 0.875em;
    padding: 0.15em 0.4em;
    background: var(--chip-bg, #f3f4f6);
    border-radius: 4px;
}

/* ----- Tablet and up: side-by-side ----- */
@media (min-width: 768px) {
    .e2e-builder {
        flex-direction: row;
        align-items: stretch;
        gap: 1.5rem;
    }

    .e2e-config {
        flex: 0 0 320px;
        max-width: 320px;
    }

    .e2e-config-inner {
        padding: 1.5rem 1.25rem;
    }

    .e2e-preview {
        flex: 1;
        min-width: 0;
    }

    .e2e-preview__inner {
        min-height: 420px;
    }

    .e2e-preview__editor {
        min-height: 420px;
    }

    .e2e-preview__body {
        min-height: 420px;
    }

    .e2e-cta {
        width: auto;
    }
}

/* ----- Desktop ----- */
@media (min-width: 1024px) {
    .e2e-config {
        flex: 0 0 360px;
        max-width: 360px;
    }

    .e2e-preview__inner {
        min-height: 500px;
    }

    .e2e-preview__editor {
        min-height: 500px;
    }

    .e2e-preview__body {
        min-height: 500px;
    }
}
