/* basis */
* {
    box-sizing: border-box;
}

body,
html {
    height: 100%;
    margin: 0;
}

body {
    font-family: sans-serif;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.canvas-container {
  -webkit-touch-callout: none; /* blokkeert lang-klik menu */
}

#plaat {
  touch-action: none;
}

.force-focus-style {
    outline: 2px solid #004b6f;
    outline-offset: 4px;
    border-radius: 4px;
}

/* layout */

.main {
    flex: 1;
    display: flex;
    flex-direction: row;
}

.canvas-container {
    overflow: auto;
    padding: 1rem;
    background: #f7f7f7;

    display: block;
    /* ⛔ flex uitschakelen */
    align-items: initial;
    /* ⛔ fallback: niet nodig, maar voorkomt misverstanden */
    justify-content: initial;
}

#plaat {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #ccc;
}

.sidebar {
    flex: 1;
    padding: 1rem;
    background: #f8f8f8;
    overflow-y: auto;
}

/* header */

.header-flex {
    background: #004b6f;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-flex h1 {
    margin: 0;
    font-size: 1.5rem;
}

.cta-link {
    background-color: #fff;
    color: #004b6f;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: bold;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.2s;
}

.cta-link:hover {
    background-color: #f0f0f0;
}

.cta-link:focus,
.cta-link:focus-visible,
.ondertitel a:focus {
  outline: 2px solid yellow;
  outline-offset: 4px;
  border-radius: 4px;
}

.ondertitel{
    margin-top: 0.4rem;
    margin-left: 0.15rem;
}

.ondertitel a {
    color: white;
    text-decoration: none;
}

.ondertitel a:hover {
    text-decoration: underline;
}

/* knoppen */

.btn {
    font: inherit;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background-color: #eee;
    border: 1px solid #ccc;
    text-align: center;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #ddd;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

label.btn:focus-visible {
  outline: 2px solid #004b6f;
  outline-offset: 4px;
  border-radius: 4px;
}

/* formulier-elementen */

input,
label,
button,
textarea,
select {
    font: inherit;
}

/* file input */
input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    pointer-events: none;
}

/* feedback */
.feedback {
    color: #b00020;
    font-weight: bold;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.feedback:empty {
    display: none;
}


/* upload */
.upload-wrapper {
    margin-bottom: 1rem;
}

#image-upload {
    display: block;
    margin-top: 0.5rem;
}

/* disclaimer */
.disclaimer {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
  padding-left: 1.5rem;
  text-indent: -1.5rem;
}

/* hotspot form */

#hotspot-form {
    margin: 2rem 0;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 100%;
    border: 1px grey solid;
    padding:1rem;
}

#hotspot-label {
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
}

#hotspot-form button {
    margin-top: 0.5rem;
    align-self: start;
}

/* hotspotlijst */

.hotspot-item {
    display: flex;
    flex-direction: column;
    /* stack bij smalle schermen */
    align-items: flex-start;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    background-color: #fff;
    margin: 0.5rem 0;
}

.hotspot-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin:0.5rem 0
  }

.hotspot-nummer {
    font-weight: bold;
}

.groep-knoppen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hotspot-knoppen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: 1.5rem; /* uitlijnen met label */
}


.hotspot-item button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.inline-edit {
    font: inherit;
    padding: 0.25rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-hotspot{
    padding: 0.25rem 0.4rem;
    font-size: clamp(0.8rem, 1vw, 1rem);
}

/* knoppengroep */
.actieknoppen {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.actieknoppen .btn {
    width: 100%;
    box-sizing: border-box;
}

a.btn {
    text-decoration: none;
    color: inherit;
}

.test-knop-container{
    margin-top:1rem;
}
/*  svg */ 


.hotspot-circle,
.hotspot-groep,
.hotspot-groep text  {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none; /* voor Safari/iOS */
}

/* .hotspot-circle{
    fill: #cce5ff;
} */


.hotspot-circle.incompleet {
    fill: red;
}

/* ⚪ Actief, maar alleen als NIET incompleet */
.hotspot-groep.actief circle:not(.incompleet) {
    fill: white;
}

.hotspot-circle {
    cursor: move;
}

.hotspot-circle:focus {
    outline: 2px dashed black;
    outline-offset: 4px;
}

.hotspot-item.actief {
    background-color: rgb(229, 239, 250);
    border-left: 4px solid #06c;
}



:focus-visible, 
.hotspot-item .hotspot-label:focus,
.hotspot-item .hotspot-label:focus-visible {
    outline: 2px solid #004b6f;
    outline-offset: 4px;
    border-radius: 4px;
}


.hotspot-circle text {
    user-select: none;
    pointer-events: none;
}

/* dialog */
dialog {
    border: none;
    padding: 1rem;
    border-radius: 0.5rem;
    max-width: 400px;
    width: 90%;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

#groep-dialog label,
#export-dialog label {
    display: block;
    margin-bottom: 0.5rem;
}

/* beschrijving-dialog formulier */
#beschrijving-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 1rem;
  }
  
  #beschrijving-form input,
  #beschrijving-form textarea {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 0.4rem;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  #beschrijving-form textarea {
    resize: vertical;
    min-height: 5rem;
  }

/* accessibility */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Alleen zichtbaar bij toetsenbordfocus */
.sr-only-focusable:focus,
.sr-only-focusable:focus-visible {
  position: static !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  margin: 0.5rem 0;
  padding: 0.25rem 0.5rem;
  background: #eef;
  color: #000;
  font-size: 1rem;
  border: 2px solid #00f;
  display: inline-block !important;
}

@media (min-width: 768px) {
    .main {
        display: flex;
        height: 100vh;
        overflow: hidden;
    }

    .canvas-container {
        flex: 1;
        overflow: auto;
        padding: 1rem;
        background: #f7f7f7;
    }

    .sidebar {
        width: 400px;
        padding: 1rem;
        background: #fff;
        overflow-y: auto;
        position: relative; /* ← niet sticky */
        scroll-behavior: smooth;
    }
    
}


/* responsive */
@media (max-width: 768px) {
    .main {
        display: block;
    }

    .canvas-container,
    .sidebar {
        width: 100%;
        height: auto;
        overflow: visible;
        position: static;
    }
}