/* ============================================================
   Match Lab – n8n Form Plugin Styles
   Pas kleuren aan via de variabelen hieronder.
   ============================================================ */

#n8n-app {
    --ml-accent:      #0057FF;
    --ml-accent-dark: #0040CC;
    --ml-success:     #0F9B6E;
    --ml-error:       #D93025;
    --ml-text:        #111111;
    --ml-muted:       #666666;
    --ml-border:      #E2E2E2;
    --ml-bg:          #FFFFFF;
    --ml-bg-soft:     #F7F8FA;
    --ml-radius:      10px;
    --ml-shadow:      0 2px 12px rgba(0,0,0,0.07);

    max-width: 520px;
    margin: 0 auto;
    font-family: inherit;
    color: var(--ml-text);
}

/* ---- Card ---- */
.n8n-card {
    background: var(--ml-bg);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    padding: 2rem;
}

.n8n-card--result {
    border-color: var(--ml-success);
    border-width: 1.5px;
}

.n8n-card--error {
    border-color: var(--ml-error);
    border-width: 1.5px;
}

/* ---- Intro text ---- */
.n8n-intro {
    font-size: 15px;
    color: var(--ml-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* ---- Form field ---- */
.n8n-field {
    margin-bottom: 1.25rem;
}

.n8n-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--ml-text);
}

.n8n-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.n8n-input-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    pointer-events: none;
    line-height: 1;
}

.n8n-input-wrap input[type="url"] {
    width: 100%;
    padding: 11px 14px 11px 38px;
    font-size: 15px;
    font-family: inherit;
    border: 1.5px solid var(--ml-border);
    border-radius: var(--ml-radius);
    background: var(--ml-bg);
    color: var(--ml-text);
    transition: border-color 0.15s;
    outline: none;
    box-sizing: border-box;
}

.n8n-input-wrap input[type="url"]:focus {
    border-color: var(--ml-accent);
    box-shadow: 0 0 0 3px rgba(0,87,255,0.12);
}

.n8n-input-wrap input[type="url"][aria-invalid="true"] {
    border-color: var(--ml-error);
}

.n8n-field-hint {
    font-size: 12px;
    color: var(--ml-muted);
    margin-top: 5px;
}

.n8n-field-error {
    font-size: 13px;
    color: var(--ml-error);
    margin-top: 5px;
    min-height: 18px;
}

/* ---- Submit button ---- */
#n8n-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    background: var(--ml-accent);
    color: #ffffff;
    border: none;
    border-radius: var(--ml-radius);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    margin-top: 0.25rem;
}

#n8n-submit-btn:hover  { background: var(--ml-accent-dark); }
#n8n-submit-btn:active { transform: scale(0.98); }

.n8n-btn-arrow {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.15s;
}

#n8n-submit-btn:hover .n8n-btn-arrow {
    transform: translateX(3px);
}

/* ---- Loader header ---- */
.n8n-loader-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    font-size: 15px;
    font-weight: 500;
    color: var(--ml-accent);
}

/* Spinner */
.n8n-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(0,87,255,0.2);
    border-top-color: var(--ml-accent);
    border-radius: 50%;
    flex-shrink: 0;
    animation: n8n-spin 0.75s linear infinite;
}

@keyframes n8n-spin {
    to { transform: rotate(360deg); }
}

/* ---- Steps ---- */
.n8n-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.n8n-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ml-border);
    animation: n8n-fade-in 0.3s ease;
}

.n8n-step:last-child { border-bottom: none; }

@keyframes n8n-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.n8n-step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    font-weight: 700;
}

.n8n-step-dot--done {
    background: var(--ml-success);
    color: #ffffff;
}

.n8n-step-dot--running {
    border: 2px solid var(--ml-accent);
    background: rgba(0,87,255,0.08);
    animation: n8n-pulse 1.2s ease-in-out infinite;
}

@keyframes n8n-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.n8n-step-name {
    font-size: 14px;
    color: var(--ml-text);
    line-height: 1.4;
}

.n8n-step--running .n8n-step-name {
    color: var(--ml-accent);
}

/* ---- Result ---- */
.n8n-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ml-success);
    margin-bottom: 1.25rem;
}

.n8n-result-icon {
    display: inline-flex;
    width: 26px;
    height: 26px;
    background: var(--ml-success);
    color: #fff;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.n8n-result-body {
    background: var(--ml-bg-soft);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.n8n-result-empty {
    font-size: 14px;
    color: var(--ml-muted);
}

/* Key/value result list */
.n8n-result-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-size: 14px;
    margin: 0;
}

.n8n-result-list dt {
    font-weight: 600;
    color: var(--ml-muted);
    white-space: nowrap;
}

.n8n-result-list dd {
    color: var(--ml-text);
    word-break: break-word;
    margin: 0;
}

/* ---- Error screen ---- */
.n8n-error-msg {
    font-size: 15px;
    color: var(--ml-error);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

/* ---- Reset button ---- */
.n8n-reset-btn {
    background: none;
    border: 1.5px solid var(--ml-border);
    border-radius: var(--ml-radius);
    padding: 10px 18px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ml-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.n8n-reset-btn:hover {
    border-color: var(--ml-accent);
    color: var(--ml-accent);
}

/* ---- Responsive ---- */
@media (max-width: 560px) {
    .n8n-card { padding: 1.25rem; }
}
