/* ── RESET & ROOT ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* STEPP_BRAND (zie inc/stepp-config.php) — darkblue = --navy,
   lightblue = --editor-blue, skin = --stepp-skin, white = --white. */
:root {
    --navy:        #0a1955;
    --navy-light:  #1a2d80;
    --navy-dark:   #091245;
    --green:       #41964B;
    --green-dark:  #3a7d4c;
    --white:       #ffffff;
    --ui-bg:       #F0F3FF;
    --ui-border:   rgba(255,255,255,0.25);
    --ui-text:     #1a1a2e;
    --ui-label:    rgba(255,255,255,0.70);
    --editor-blue: #00A0D2;
    --stepp-skin:  #f0be8c;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--ui-bg);
    color: var(--ui-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ──────────────────────────────────────────────────────────────── */
header {
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 20px;
}
header .logo-mark {
    width: 50px;
    height: 50px;
    background: var(--navy);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── WORKSPACE ───────────────────────────────────────────────────────────── */
.workspace {
    display: flex;
    flex: 1;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* ── EDITOR SIDEBAR ──────────────────────────────────────────────────────── */
.editor {
    width: 500px;
    min-width: 300px;
    height: 85vh;
    margin: auto 0;
    background: var(--editor-blue);
    border-top-right-radius: 40px;
    border-bottom-right-radius: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding-bottom: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.editor::-webkit-scrollbar { width: 4px; }
.editor::-webkit-scrollbar-track { background: transparent; }
.editor::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }

/* ── EDITOR SECTIONS ─────────────────────────────────────────────────────── */
.editor-section {
    width: 100%;
    max-width: 420px;
    padding: 20px 0 0;
}
.editor-section + .editor-section { padding-top: 12px; }

.section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.55);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.2);
}

/* ── FIELDS ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: 12px; }
.field label {
    display: block;
    text-transform: lowercase;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    margin-bottom: 5px;
}
.field input[type="text"],
.field textarea {
    width: 100%;
    padding: 10px 16px;
    border-radius: 100px;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: var(--ui-text);
    background: rgba(255,255,255,0.93);
    outline: none;
    transition: background 0.15s;
}
.field textarea {
    border-radius: 16px;
    height: 80px;
    line-height: 1.5;
    resize: none;
}
.field input[type="text"]:focus,
.field textarea:focus {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}
.field select {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 100px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: var(--ui-text);
    background: rgba(255,255,255,0.93);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6080' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-color: rgba(255,255,255,0.93);
    padding-right: 36px;
}
.field select:focus { box-shadow: 0 0 0 2px rgba(255,255,255,0.5); }

/* ── RICH TEXT VELDEN (vet/cursief/kleur) ──────────────────────────────────── */
.rich-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.rich-toolbar button {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.rich-toolbar button:hover { background: rgba(255,255,255,0.32); }
.rich-toolbar .rich-color-list { display: flex; gap: 4px; margin-left: 2px; }
.rich-toolbar .rich-color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.6);
    padding: 0;
    cursor: pointer;
}
.rich-toolbar .rich-color-custom {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    margin-left: 2px;
    padding: 0;
    border: 1.5px dashed rgba(255,255,255,0.6);
    border-radius: 50%;
    background: none;
    cursor: pointer;
}
.rich-toolbar .rich-color-custom::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
.rich-toolbar .rich-color-custom::-webkit-color-swatch { border: none; border-radius: 50%; }

.rich-input {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: 10px 16px;
    border-radius: 100px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: var(--ui-text);
    background: rgba(255,255,255,0.93);
    outline: none;
    transition: background 0.15s;
    white-space: nowrap;
    overflow-x: auto;
}
.rich-input--area {
    border-radius: 16px;
    height: 80px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-x: hidden;
    overflow-y: auto;
}
.rich-input:focus { background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.5); }
.rich-input:empty::before {
    content: attr(data-placeholder);
    color: rgba(26,26,46,0.45);
}

/* ── RICH TEXT TYPOGRAFIE: regulier = light (300), vet = semibold (600) ───── */
.rich-input { font-weight: 300; }
.rich-input b, .rich-input strong { font-weight: 600; }

/* ── FIELD ROW ───────────────────────────────────────────────────────────── */
.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    margin-bottom: 6px;
}
.field-row label { margin-bottom: 0; }

/* ── TOGGLE SWITCH ───────────────────────────────────────────────────────── */
.toggle-switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.25);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s;
}
.toggle-switch .slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 2px; top: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .slider { background: var(--navy-dark); }
.toggle-switch input:checked + .slider::before { transform: translateX(16px); }

/* ── TOGGLE BUTTONS ──────────────────────────────────────────────────────── */
.toggle-group { display: flex; gap: 6px; }
.toggle-btn {
    flex: 1;
    padding: 9px 6px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 100px;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.toggle-btn.active {
    background: rgba(255,255,255,0.93);
    border-color: transparent;
    color: var(--navy);
    font-weight: 600;
}

/* ── OPTIONAL BODY ───────────────────────────────────────────────────────── */
.optional-body { display: none; }
.optional-body.enabled { display: block; }

/* ── UPLOAD AREA ─────────────────────────────────────────────────────────── */
.upload-area {
    border: 2px dashed rgba(255,255,255,0.35);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: rgba(255,255,255,0.08);
    display: block;
}
.upload-area:hover { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.14); }
.upload-area input { display: none; }
.upload-area p { font-size: 12px; color: rgba(255,255,255,0.7); line-height: 1.6; }
.upload-area strong { color: #fff; }
#img-preview-thumb { width: 100%; max-height: 80px; object-fit: cover; border-radius: 6px; margin-top: 8px; display: none; }

/* ── POSITION GRID ───────────────────────────────────────────────────────── */
.position-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 96px; margin-top: 8px; }
.position-cell {
    width: 28px; height: 28px;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: rgba(255,255,255,0.12);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.position-cell::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.6); }
.position-cell:hover { border-color: rgba(255,255,255,0.6); }
.position-cell.active { background: var(--navy-dark); border-color: var(--navy-dark); }
.position-cell.active::before { background: white; }

/* ── IMAGE FIELD: UPLOAD + POSITIE NAAST ELKAAR ─────────────────────────── */
.image-upload-row { display: flex; align-items: flex-start; gap: 10px; }
.image-upload-row .upload-area { flex: 1; min-width: 0; padding: 14px 8px; }
.image-upload-row .upload-area p { font-size: 11px; }
.image-position-col { flex-shrink: 0; display: flex; align-items: center; }
.image-position-col .position-grid { margin-top: 0; width: 92px; }
.image-position-col .position-cell { width: 26px; height: 26px; }

/* ── IMAGE FIELD: ZOOM-SLIDER ────────────────────────────────────────────── */
.image-zoom-row { margin-top: 10px; }
.image-zoom-row label { display: flex; justify-content: space-between; align-items: center; }

/* Geldt voor élke slider in de sidebar: het range-veld van een "range"-veld
   uit het field_schema én de zoom-slider van het afbeeldingsveld. */
.field input[type="range"],
.image-zoom-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    margin: 2px 0;
    border-radius: 100px;
    background: rgba(255,255,255,0.28);
    outline: none;
    cursor: pointer;
}
.field input[type="range"]::-webkit-slider-thumb,
.image-zoom-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px; height: 14px;
    border: none;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
.field input[type="range"]::-moz-range-thumb,
.image-zoom-row input[type="range"]::-moz-range-thumb {
    width: 14px; height: 14px;
    border: none;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
.range-value { font-size: 11px; color: rgba(255,255,255,0.60); font-variant-numeric: tabular-nums; }

/* ── NOTES ───────────────────────────────────────────────────────────────── */
.bleed-note { font-size: 11px; color: rgba(255,255,255,0.60); margin-top: 4px; line-height: 1.5; }

/* ── SPELL WARNING ───────────────────────────────────────────────────────── */
.spell-warning {
    display: none;
    margin-top: 6px;
    padding: 8px 10px;
    background: #fff4e5;
    border: 1px solid #f3c98a;
    border-radius: 10px;
    font-size: 11.5px;
    color: #8a5a17;
    line-height: 1.5;
}
.spell-warning.visible { display: block; }
.spell-warning strong { color: #6b4400; }
.spell-warning .sw-item { margin-bottom: 4px; }
.spell-warning .sw-item:last-child { margin-bottom: 0; }

/* ── EXPORT AREA ─────────────────────────────────────────────────────────── */
.export-area {
    width: 100%;
    max-width: 420px;
    padding: 16px 0 24px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.18);
}
.btn-export {
    width: 100%;
    padding: 13px 20px;
    background: var(--navy-dark);
    color: #fff;
    border: none;
    border-radius: 100px;
    text-transform: lowercase;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.btn-export:hover { background: #060d30; }
.btn-export:active { transform: scale(0.98); }
.btn-export:disabled { background: rgba(0,0,0,0.3); cursor: not-allowed; }
.btn-export--jpeg { background: #1a6b2e; }
.btn-export--jpeg:hover { background: #144f22; }
.btn-export--png { background: #6b3fa0; }
.btn-export--png:hover { background: #522f7d; }
.btn-export--social { background: #c1440e; }
.btn-export--social:hover { background: #9b360b; }

/* ── STIJLVARIANTEN (kaartenkiezer) ─────────────────────────────────────── */
#style-variant-picker {
    width: 100%;
    max-width: 420px;
    padding-top: 20px;
}
#style-variant-picker > label {
    display: block;
    text-transform: lowercase;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
}
.style-variant-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.style-variant-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: rgba(255,255,255,0.08);
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: 'Outfit', sans-serif;
}
.style-variant-card:hover { background: rgba(255,255,255,0.16); }
.style-variant-card.active { border-color: var(--navy-dark); background: rgba(255,255,255,0.18); }
.style-variant-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}
.style-variant-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.style-variant-thumb--empty {
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--navy-dark);
}
.style-variant-name {
    font-size: 11px;
    text-transform: lowercase;
    color: rgba(255,255,255,0.85);
    text-align: center;
    line-height: 1.3;
}

/* ── PREVIEW PANEL ───────────────────────────────────────────────────────── */
.preview-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--ui-bg);
    overflow: auto;
}

/* ── POSTER PREVIEW ──────────────────────────────────────────────────────── */
.poster-background {
    padding: 20px;
    background-color: var(--green);
}
.poster-wrap {
    position: relative;
    filter: drop-shadow(0 8px 40px rgba(13,27,94,0.22));
}
.poster {
    width: 420px;
    height: 594px;
    border-radius: 25px;
    position: relative;
    background: var(--navy);
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
}

/* Logo */
.poster-logo {
    position: absolute;
    top: 0; left: 7%;
    width: 100px; height: 60px;
    background: var(--white);
    border-radius: 0 0 10px 10px;
    padding: 10px 10px 10px 15px;
    margin-top: -20px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.poster-logo svg,
.poster-logo img {
    width: 100%; height: 100%;
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Inhoud */
.poster-top { padding: 130px 36px 0; flex-shrink: 0; }
.infinity-icon { width: 44px; height: 28px; margin-bottom: 12px; }
.poster-title { font-size: 40px; font-weight: 600; color: var(--white); text-transform: lowercase; line-height: 1.05; word-break: break-word; transition: all 0.2s; }
.poster-subtitle-wrap { margin-top: 14px; }
.poster-subtitle { display: inline-block; background: var(--green); color: var(--white); font-size: 13px; font-weight: 600; padding: 3.5px 16px; border-radius: 100px; transition: all 0.2s; }

/* Blob */
.poster-blob-section { flex: 1; position: relative; display: flex; align-items: center; justify-content: flex-start; margin-top: 20px; overflow: hidden; }
.blob-shape { position: absolute; left: -24px; width: 82%; top: 0; height: 100px; background-color: var(--white); background-size: cover; background-repeat: no-repeat; background-position: center center; border-radius: 0 120px 120px 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 5px 28px 5px 64px; }
.blob-text-content { font-size: 13px; color: var(--navy); line-height: 1.55; font-weight: 500; white-space: pre-wrap; word-break: break-word; }

/* Quote */
.poster-quote { display: none; margin: auto 36px 16px; }
.poster-quote.enabled { display: block; position: absolute; bottom: -140px; left: 3; }

/* Pijl */
.poster-arrow { display: none; margin: 10px 36px 0; width: 28px; height: 28px; }
.poster-arrow.enabled { display: block; }
.poster-arrow.dir-right { transform: rotate(0deg); }
.poster-arrow.dir-left  { transform: rotate(180deg); }
.poster-arrow.dir-down  { transform: rotate(90deg); }
.poster-arrow.dir-up    { transform: rotate(-90deg); }

/* Contact */
.poster-contact { display: none; margin: 0 36px 24px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.15); color: var(--white); font-size: 11px; line-height: 1.7; }
.poster-contact.enabled { display: block; }
.poster-contact .contact-line { display: flex; align-items: center; gap: 6px; }
.poster-contact .contact-line + .contact-line { margin-top: 2px; }

/* ── PREVIEW TABS (voor/achterkant) ──────────────────────────────────────── */
#preview-tabs {
    position: absolute;
    top: 50px;
    left: 80px;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.preview-tab {
    padding: 7px 22px;
    border: 2px solid rgba(10,25,85,0.2);
    border-radius: 100px;
    background: rgba(255,255,255,0.6);
    color: var(--navy);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    text-transform: lowercase;
}
.preview-tab:hover {
    border-color: var(--navy);
    background: rgba(255,255,255,0.85);
}
.preview-tab.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    font-weight: 600;
}

/* ── EXPORT OVERLAY ──────────────────────────────────────────────────────── */
#export-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(10,25,85,0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}
#export-overlay.visible { display: flex; }
.spinner {
    width: 42px; height: 42px;
    border: 3px solid rgba(255,255,255,0.25);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ARROW BUTTONS ───────────────────────────────────────────────────────── */
.arrow-direction-group { display: flex; gap: 6px; }
.arrow-btn {
    flex: 1; padding: 10px 6px;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    color: rgba(255,255,255,0.8);
}
.arrow-btn.active { background: var(--navy-dark); border-color: var(--navy-dark); color: white; }

/* ── SCHEMA FIELDS ───────────────────────────────────────────────────────── */
#schema-fields-wrap {
    width: 100%;
    max-width: 420px;
    padding-top: 20px;
}
#schema-fields-wrap.visible {
    display: block !important;
}
