/* ==========================================================================
   WDS ProBuild - Plooiwerk Configurator Specifieke Styling (Grid based layout)
   ========================================================================== */

/* Overkoepelende Variabelen voor de tekening (behoudt zichtbaarheid in alle theamas) */
.plooiwerk-app {
    --accent: #f59e0b;
    --blue: #38bdf8;
    --green: #22c55e;
    --red: #ef4444;
    --purple: #c084fc;
    --svg-bg: #0f1115;
    --svg-card-bg: #17191d;
    --svg-text: #f3f4f6;
    
    max-width: 1480px !important;
    padding-top: 20px;
	margin: 0 auto; /* DIT ZORGT VOOR HET CENTREREN */
}

/* ── Layout Basis ── */
.layout { 
    display: grid; 
    grid-template-columns: minmax(590px, 690px) 1fr; 
    gap: 20px; 
    align-items: start; 
}
.right-stack { 
    display: grid; 
    gap: 20px; 
}

/* ── Kaarten (Cards) ── */
.header-card, .warning-card, .form-card, .results-card, .sketch-card { 
    padding: 24px; 
}
.header-card { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 18px; 
    margin-bottom: 20px; 
    border-left: 4px solid var(--accent);
}
.header-card h1 { 
    margin: 0; 
    font-size: 26px; 
}
.header-card p { 
    margin: 6px 0 0; 
    color: var(--dim); 
    font-size: 14px;
}
.badge { 
    color: var(--dim); 
    font-size: 13px; 
    white-space: nowrap; 
    background: var(--bg);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* ── Status en Waarschuwingen ── */
.warning-card { 
    margin-bottom: 20px; 
}
.status-ok { 
    border-color: rgba(34,197,94,0.35); 
    background: rgba(34,197,94,0.08); 
}
.status-ok h3 { 
    margin: 0; 
    color: var(--success); 
    font-size: 16px; 
}

/* ── Formulier Groepen & Grids ── */
.group { 
    padding: 20px 0; 
    border-top: 1px solid var(--border); 
}
.group:first-child { 
    border-top: 0; 
    padding-top: 0; 
}
.group-head { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 16px; 
    margin-bottom: 16px; 
}
.group-head h3, .section-title { 
    margin: 0; 
    font-size: 17px; 
    color: var(--text);
}
.chip { 
    font-size: 12px; 
    color: var(--dim); 
    padding: 4px 10px; 
    border-radius: 999px; 
    border: 1px solid var(--border); 
    background: var(--bg); 
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ── Invoervelden (Fields) ── */
.field { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}
.field label { 
    font-size: 13px; 
    font-weight: 600;
    color: var(--text); 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}
.field input, .field select, .preset-select { 
    width: 100%; 
    background: var(--bg); 
    color: var(--text); 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    padding: 10px 12px; 
    font-size: 14px;
}
.field input:focus, .field select:focus, .preset-select:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); 
}

/* ── Segment Rijen (Configurator) ── */
.segment-row { 
    display: grid; 
    grid-template-columns: 1fr 1fr 1fr auto; 
    gap: 12px; 
    align-items: end; 
    background: var(--bg); 
    padding: 14px; 
    border-radius: 10px; 
    margin-bottom: 10px; 
    border: 1px solid var(--border); 
}
.segment-handle { 
    cursor: grab; 
    color: var(--dim); 
    padding-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
}
.segment-handle:active { cursor: grabbing; }

/* ── Buttons ── */
.btn {
    appearance: none; 
    border: 0; 
    border-radius: 8px; 
    padding: 10px 16px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 14px;
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 8px; 
    transition: 0.15s;
}
.btn-primary { 
    background: var(--primary); 
    color: #fff; 
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { 
    background: var(--bg); 
    color: var(--text); 
    border: 1px solid var(--border); 
}
.btn-secondary:hover { background: var(--border); }
.btn-danger { 
    background: #fef2f2; 
    color: var(--danger); 
    border: 1px solid #fecaca; 
    padding: 10px;
}
.btn-danger:hover { background: #fee2e2; }
.w-100 { width: 100%; }
.action-row { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px; 
    margin-top: 24px; 
}

/* ── Statistieken ── */
.stats { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px; 
    margin-top: 10px; 
}
.stat { 
    background: var(--bg); 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    padding: 16px; 
}
.stat .label { 
    display: block; 
    font-size: 11px; 
    color: var(--dim); 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    font-weight: 600;
}
.stat .value { 
    display: block; 
    margin-top: 6px; 
    font-size: 18px; 
    font-weight: 700; 
    color: var(--text);
}

.primary-stat { border-bottom: 3px solid var(--primary); }
.success-stat { border-bottom: 3px solid var(--success); }
.warning-stat { border-bottom: 3px solid var(--accent); }

/* ── UI Elementen ── */
.tip { 
    width: 16px; 
    height: 16px; 
    border-radius: 50%; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    background: #eff6ff; 
    border: 1px solid #bfdbfe; 
    color: var(--primary); 
    font-size: 10px; 
    font-weight: bold;
    cursor: help; 
}

/* ── SVG Werkruimte ── */
.drawing-container svg { 
    background: var(--svg-bg); 
    border-radius: 10px; 
    border: 1px solid var(--border); 
    width: 100%; 
    height: 400px; 
    display: block;
}
.joint-handle { pointer-events: all; fill: var(--blue); transition: fill-opacity .12s ease; }
.joint-handle:not(.joint-fixed) { cursor: grab; touch-action: none; }
.joint-handle:not(.joint-fixed):hover { fill-opacity: .28 !important; }
.joint-handle.joint-fixed { cursor: default; fill: var(--green); }
.segment-line-handle { pointer-events: stroke; cursor: move; touch-action: none; transition: stroke-opacity .12s ease; }
.segment-line-handle:hover { stroke-opacity: .22 !important; }
svg#svgPreview.dragging-active { cursor: grabbing; }

.drag-hint { 
    font-size: 12px; 
    color: var(--dim); 
    margin: 12px 0 0; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    line-height: 1.4;
}

/* ── Responsiviteit ── */
@media (max-width: 1280px) { .layout { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .grid-2, .grid-3, .segment-row { grid-template-columns: 1fr; } }

/* ── Print ── */
@media print { 
    .joint-handle, .segment-line-handle, .drag-hint, .action-row, .sidebar, .btn { display: none !important; } 
    .drawing-container svg { background: #fff; border: 1px solid #000; }
}