/* --- Algemene Styling --- */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f8ff;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    padding: 15px;
    background-color: #4682b4;
    color: white;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.back-link {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    text-decoration: none;
    font-size: 1em;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    transition: background-color 0.2s;
}

.back-link:hover {
    background-color: rgba(255, 255, 255, 0.3);
}


h1, h3 {
    margin: 0;
}

button {
    background-color: #5a9bd5;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    margin-top: 10px;
}

button:hover {
    background-color: #4a8bcc;
}

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

/* --- Hoofd layout --- */
#main-content {
    display: flex;
    flex-grow: 1;
    gap: 15px;
    padding: 15px;
    overflow: hidden;
}

#left-panel, #right-panel {
    flex-basis: 280px;
    flex-shrink: 0;
    background-color: #ffffff;
    border: 1px solid #d4eaf7;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
}

#center-panel {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #d4eaf7;
    border-radius: 8px;
    padding: 10px;
}

#drawingCanvas {
    background-color: white;
    cursor: crosshair;
}

#drawingCanvas.eraser-cursor {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="none" stroke="black" stroke-width="2"/></svg>') 12 12, auto;
}

#drawingCanvas.move-cursor {
    cursor: move;
}

/* --- Controls Styling --- */
.control-group {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.control-group:last-child {
    border-bottom: none;
}

.tool-setting {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}
.tool-setting label {
    flex-basis: 80px;
}

input[type="number"] {
    width: 100%;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.melding {
    margin-top: 15px;
    font-weight: bold;
    color: #d9534f;
    min-height: 20px;
}

#tool-palette {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

#tool-palette button {
    margin-top: 0;
    padding: 8px;
}

.tool-btn.selected {
    background-color: #ff8c00;
    border: 2px solid #d97800;
}

.grid-modifiers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.grid-modifiers span {
    font-weight: bold;
    text-align: center;
}

.grid-modifiers button {
    flex-basis: 40px;
    padding: 5px;
    font-size: 1.2em;
    margin-top: 0;
}

/* --- Output Styling --- */
#output-container {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    background-color: #f9f9f9;
    margin-bottom: 15px;
}

#instructions-header {
    font-weight: bold;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

#instructions-output {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 50px;
    padding: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1em;
}

#worksheetCanvas {
    width: 100%;
    height: auto;
    margin-top: 10px;
    background-color: white;
}

/* --- Catalogus Modal Styling --- */
.modal{display:none;position:fixed;z-index:1000;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgba(0,0,0,0.5)}
.modal-content{background-color:#fefefe;margin:10% auto;padding:20px;border:1px solid #888;width:80%;max-width:700px;border-radius:8px}
.close-button{color:#aaa;float:right;font-size:28px;font-weight:bold;cursor:pointer}
#modal-header{display:flex;align-items:center;margin-bottom:20px}
#modal-title{margin:0;flex-grow:1;text-align:center}
#backToThemesBtn{margin-right:15px;width:auto}
.catalog-view{display:grid;grid-template-columns:repeat(auto-fill, minmax(150px, 1fr));gap:15px}
#catalogBtn{background-color:#28a745}
#catalogBtn:hover{background-color:#218838}

.catalog-theme-button {
    width: auto;
    margin-top: 0;
    padding: 12px 15px;
    font-size: 1.1em;
    font-weight: bold;
}

.catalog-choice-button{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;background-color:#fff;border:1px solid #d4eaf7;border-radius:8px;padding:10px;text-align:center;cursor:pointer;transition:transform .2s ease,box-shadow .2s ease;height:150px; width: 100%; margin-top: 0;}
.catalog-choice-button:hover{transform:translateY(-5px);box-shadow:0 4px 12px rgba(0,64,128,0.15)}
.catalog-choice-button img{width:100%;height:100px;object-fit:contain;margin-bottom:8px}
.catalog-choice-button span{font-size:14px;color:#004080;font-weight:700}