/**
 * design-picker.css
 * Popup "Mijn ontwerpen" in het lesformulier.
 * Stijl volgt de bestaande tekentool-popup (.wmstek-start-modal).
 */

.vbmdp-open-wrap {
    margin-bottom: 20px;
}

.vbmdp-open-label {
    margin: 0 0 8px;
    font-size: 16px;
    color: #0a0a38;
}

.vbmdp-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    border: 0;
    border-radius: 10px;
    background: #6f91be;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .15s ease;
}

.vbmdp-open-btn:hover,
.vbmdp-open-btn:focus-visible {
    background: #5b7ba5;
}

.vbmdp-open-btn i {
    font-size: 15px;
}

/* ------------------------------------------------------------- overlay --- */
.vbmdp-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .5);
}

.vbmdp-overlay[hidden] {
    display: none;
}

body.vbmdp-open {
    overflow: hidden;
}

.vbmdp-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 900px;
    max-height: 88vh;
    padding: 30px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
    font-family: inherit;
    color: #0a0a38;
}

/* -------------------------------------------------------------- header --- */
.vbmdp-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
}

.vbmdp-head[hidden] {
    display: none;
}

.vbmdp-head h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    color: #0a0a38;
}

.vbmdp-stepcount {
    font-style: italic;
    font-size: 14px;
    color: #6b7280;
}

.vbmdp-tabs {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.vbmdp-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 0;
    border-radius: 8px;
    background: #f0f2f5;
    color: #666;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.vbmdp-tab.is-active {
    background: #0090e3;
    color: #fff;
    cursor: default;
}

.vbmdp-close {
    padding: 0 4px;
    border: 0;
    background: none;
    color: #6b7280;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.vbmdp-close:hover {
    color: #0a0a38;
}

.vbmdp-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: #0090e3;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.vbmdp-design-name {
    font-size: 20px;
    font-weight: 800;
}

/* ---------------------------------------------------------------- body --- */
.vbmdp-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-top: 20px;
}

.vbmdp-body[hidden] {
    display: none;
}

.vbmdp-search {
    margin-bottom: 18px;
}

.vbmdp-search .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.vbmdp-search input {
    width: 100%;
    max-width: 320px;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
}

.vbmdp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ------------------------------------------------------ ontwerp-kaartje --- */
.vbmdp-card {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 10px;
    background: #f8f9fa;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease;
}

.vbmdp-card:hover,
.vbmdp-card:focus-visible {
    border-color: #0090e3;
}

.vbmdp-thumb {
    display: block;
    aspect-ratio: 1420 / 1190;
    overflow: hidden;
    border-radius: 6px;
    background: #e9ecef;
}

.vbmdp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vbmdp-card-title {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: #0a0a38;
}

.vbmdp-card-date {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

/* -------------------------------------------------------------- slides --- */
.vbmdp-slides {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.vbmdp-slide {
    position: relative;
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 10px;
    background: #f8f9fa;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.vbmdp-slide:hover {
    border-color: #b9dcf3;
}

.vbmdp-slide.is-selected {
    border-color: #0090e3;
    box-shadow: 0 0 0 2px rgba(0, 144, 227, .25);
}

.vbmdp-slide-img {
    display: block;
    aspect-ratio: 1420 / 1190;
    overflow: hidden;
    border-radius: 6px;
    background: #e9ecef;
}

.vbmdp-slide-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vbmdp-slide-fail {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 8px;
    font-size: 13px;
    color: #6b7280;
}

.vbmdp-slide-label {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
}

.vbmdp-check {
    position: absolute;
    top: 18px;
    right: 18px;
    display: none;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #0090e3;
    color: #fff;
    font-size: 13px;
}

.vbmdp-slide.is-selected .vbmdp-check {
    display: flex;
}

.vbmdp-added {
    position: absolute;
    top: 18px;
    left: 18px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(10, 10, 56, .8);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

/* ----------------------------------------------------- skeleton / leeg --- */
.is-skeleton {
    display: block;
    aspect-ratio: 1420 / 1190;
    border: 2px solid #eee;
    border-radius: 10px;
    background: linear-gradient(90deg, #f1f3f5 25%, #e9ecef 37%, #f1f3f5 63%);
    background-size: 400% 100%;
    animation: vbmdp-shimmer 1.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes vbmdp-shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .is-skeleton { animation: none; }
}

.vbmdp-empty {
    grid-column: 1 / -1;
    padding: 30px 0;
    text-align: center;
    color: #6b7280;
}

.vbmdp-empty p {
    margin: 0 0 16px;
}

/* -------------------------------------------------------------- footer --- */
.vbmdp-foot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 18px;
    margin-top: 4px;
    border-top: 1px solid #eee;
}

.vbmdp-foot.is-bare {
    padding-top: 0;
    border-top: 0;
}

.vbmdp-status {
    font-size: 14px;
    color: #6b7280;
}

.vbmdp-status.is-error {
    color: #c0392b;
}

.vbmdp-btn {
    padding: 13px 28px;
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.vbmdp-btn-primary {
    background: #0090e3;
    color: #fff;
}

.vbmdp-btn-primary:disabled {
    background: #e4e7ed;
    color: #98a0ae;
    cursor: not-allowed;
}

#vbmdp-insert {
    margin-left: auto;
}

/* --------------------------------------------------------------- toast --- */
.vbmdp-toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    z-index: 100001;
    transform: translate(-50%, 20px);
    padding: 14px 22px;
    border-radius: 10px;
    background: #0a0a38;
    color: #fff;
    font-size: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.vbmdp-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* --------------------------------------------------------------- mobiel --- */
@media (max-width: 767px) {
    .vbmdp-overlay {
        padding: 0;
    }

    .vbmdp-modal {
        max-width: none;
        max-height: 100vh;
        height: 100%;
        padding: 18px;
        border-radius: 0;
    }

    .vbmdp-head h2 {
        font-size: 20px;
    }

    /* Tabknoppen onder elkaar, elk over de volle breedte.
       Volgorde volgt de DOM: eerst "Nieuw ontwerp maken", dan "Mijn ontwerpen". */
    .vbmdp-tabs {
        order: 3;
        flex-direction: column;
        width: 100%;
        margin-left: 0;
    }

    .vbmdp-tab {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 15px;
    }

    .vbmdp-close {
        margin-left: auto;
    }

    .vbmdp-grid,
    .vbmdp-slides {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .vbmdp-foot {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-bottom: 4px;
    }

    .vbmdp-btn {
        padding: 13px 20px;
    }
}

/* ------------------------------------------------------------------ *
 * Uploadlijst bij maximaal één afbeelding.
 * image-upload.js zet de klassen 'nodropdown' en 'single-file' op
 * #file_list. Zonder die klassen verandert er niets aan de bestaande
 * opmaak in custom.css, dus het oefeningenformulier blijft ongemoeid.
 * ------------------------------------------------------------------ */

#file_list.single-file .file-item {
    grid-template-columns: 70px 1fr auto;
    padding-left: 0;
    align-items: center;
}

/* Verwijderen tegen de rechterrand. */
#file_list.single-file .file-item .remove-btn {
    justify-self: end;
}

/* Volgordepijltjes hebben bij één afbeelding geen functie. Ook een vangnet
   voor browsers die nog een oude image-upload.js uit de cache draaien. */
#file_list.single-file .move-btn {
    display: none;
}

/* Foutmelding onder de uploadlijst (gevuld door image-upload.js). */
.upload-melding {
    margin: 10px 0 0;
    color: #c0392b;
    font-size: 14px;
}
