/* --- ALGEMENE STIJLEN & LAYOUT --- */
body {
    font-family: Arial, sans-serif;
    background-color: #e0f2f7;
    text-align: center;
    padding: 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
    box-sizing: border-box;
}

h1 {
    color: #004080;
    font-size: 2em;
    text-align: center;
    margin: 0;
}

#menuBtn {
    width: auto;
    white-space: nowrap;
    background-color: #004080;
    color: white;
    border: none;
    padding: 12px 18px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
}
#menuBtn:hover {
    background-color: #0056b3;
}


.header-spacer {
    width: 125px;
    visibility: hidden;
}

h3 {
    color: #004080;
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
    border-bottom: 1px solid #b3e0ff;
    padding-bottom: 10px;
}

button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

#left-panel button, #right-panel-buttons button {
    font-family: Arial, sans-serif;
    background-color: #004080;
    color: white;
    border: none;
    padding: 12px 18px;
    font-size: 1em;
    border-radius: 8px;
    cursor: pointer;
    margin: 5px 0;
    transition: background-color 0.2s ease;
    width: 100%;
}

#left-panel button:hover:not(:disabled), #right-panel-buttons button:hover {
    background-color: #0056b3;
}

/* Speciale kleur voor de "actieve" verplaats-knop */
#enable-move-btn.active {
    background-color: #ff8c00;
}

#main-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    gap: 20px;
    margin-bottom: 20px;
}

#left-panel, #right-panel-buttons {
    flex-basis: 250px;
    flex-shrink: 0;
    padding: 15px;
    border: 1px solid #b3e0ff;
    border-radius: 8px;
    background-color: #f0faff;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-sizing: border-box;
    text-align: left;
}

#center-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    padding: 15px;
    border: 1px solid #b3e0ff;
    border-radius: 8px;
    background-color: #ffffff;
    box-sizing: border-box;
    min-height: 600px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
}

#file-feedback {
    font-size: 0.9rem;
    color: #004080;
    font-weight: bold;
    text-align: center;
    min-height: 20px;
}

#imageUpload { display: none; }

#keuze-werkblad-type {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 1rem;
    color: #333;
    text-align: left;
    width: 100%;
}
#keuze-werkblad-type label { cursor: pointer; }
#keuze-werkblad-type input[type="radio"] { margin-right: 8px; }
#keuze-werkblad-type input:disabled + span { color: #999; }

/* --- WEERGAVE STIJLEN --- */
#werkbladWeergave {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.preview-grid, .selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.placeholder-text, .selection-title {
    text-align: center;
    margin-top: 50px;
    font-size: 1.3rem;
    color: #888;
}

.selection-title { margin-bottom: 20px; }

.image-preview-item, .shadow-pair-container, .selection-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.selection-item {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.selection-item:hover {
    border-color: #ff8c00;
    transform: scale(1.05);
}

.image-preview-item img, .shadow-pair-container img, .selection-item img {
    max-width: 100%;
    object-fit: contain;
}

.shadow-pair-container .image-wrapper {
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.werkblad-container-final { 
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 100px;
    width: 100%;
    align-items: start;
}

.kolom { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    align-items: center; 
}

.item-wrapper { 
    width: 150px; 
    height: 150px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background-color: #fff; 
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1); 
    border: 2px solid #ccc; 
    border-radius: 10px; 
    transition: border-color 0.2s;
}
.item-wrapper img { max-width: 90%; max-height: 90%; object-fit: contain; }

/* LAYOUT VOOR 'MIDDEN OBJECT' WERKBLAD */
.werkblad-type-1-final { 
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 700px;
}
.werkblad-type-1-final .midden-object { 
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid #ff8c00; 
    border-radius: 50%; 
    padding: 10px; 
    z-index: 10; 
    width: 180px; 
    height: 180px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background-color: white; 
}
.werkblad-type-1-final .midden-object img { 
    max-width: 150px;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.werkblad-type-1-final .item-wrapper { 
    border: none; 
    background-color: transparent; 
    box-shadow: none; 
    position: absolute;
    width: 120px;
    height: 120px;
}
.werkblad-type-1-final .item-wrapper img {
    transform-origin: center center;
}

/* STIJLEN VOOR VERFIJN-MODUS */
.werkblad-type-1-final.move-mode-active .item-wrapper {
    cursor: grab;
    border: 2px dashed #007bff;
}
.werkblad-type-1-final.move-mode-active .item-wrapper.dragging {
    cursor: grabbing;
    opacity: 0.8;
    z-index: 1000;
    border-style: solid;
}

.werkblad-type-1-final .item-wrapper.selected-for-edit {
    border: 3px solid #28a745;
    cursor: pointer;
}

.sub-control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
    padding: 10px;
    border: 1px dashed #b3e0ff;
    border-radius: 8px;
    margin-top: 10px;
}

#size-feedback {
    font-size: 0.9em;
    font-weight: bold;
    color: #004080;
}


canvas { display: none; }
footer { margin-top: auto; padding: 20px; color: #555; }