/* Sticky container */
.sticky-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    padding: 0;
    margin: 0;
    contain: layout style paint;
    overflow: visible;
}

.sticky-wrapper h1 {
    margin: 0;
    padding: 0.25rem 0;
    line-height: 1.2;
}

.hotspot-wrapper {
    overflow: visible;
}

.hotspot-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

/* Timed images */
.timed-images img{
    width: 100%;
    border-radius: 8px;
}

/* Container voor alle content */
.audio-stop {
    max-width: 400px;
    margin: 0 auto;
    padding: 0.5rem;
}

/* Audio player */
#audio-player {
    width: 100%;
    max-width: 400px;
    height: 40px;
    margin: 0.25rem auto;
    display: block;
}

.video-button {
    width: 100%;
    padding: 0.85rem 1rem;
    margin: 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: #007bff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    touch-action: auto;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
}

.video-modal__close {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
}

.video-button:hover {
    background: #0056d6;
}

.video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 10000;
}

.video-modal__content {
    width: min(100%, 900px);
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.video-modal__close {
    align-self: flex-end;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.video-modal video {
    width: 100%;
    max-height: calc(90vh - 120px);
    border-radius: 12px;
    background: black;
    object-fit: contain;
}

.video-modal__content {
    overflow-y: auto;
}

.hidden {
    display: none;
}

/* Navigatie */
.stop-navigation {
    display: grid;
    grid-template-columns: auto auto auto auto;
    align-items: left;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0.25rem 0;
}

.nav-slot {
    display: flex;
    align-items: center;
}

.nav-slot:first-child {
    justify-content: flex-start;
}

.nav-slot:nth-child(2),
.nav-slot:nth-child(3) {
    justify-content: center;
}

.nav-slot:last-child {
    justify-content: flex-end;
}

/* Knoppen */
.nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
}

.nav-button img {
    width: 32px;
    height: 32px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.nav-button img:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Description toggle */
.description {
    font-family: "Open Sans", sans-serif;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: z-index 0.1s, background 0.2s;
}

.description.expanded {
    position: relative;
    z-index: 101;
    background: white;
    padding: 1rem;
    margin: -0.5rem -0.5rem 0 -0.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Help & AVO widgets */
.help-widget,
.avo-widget {
    position: fixed;
    right: 10px;
    z-index: 9999;
}

.help-widget {
    top: 100px;
}

.avo-widget {
    top: 200px;
}

.help-button,
.avo-button {
    background: rgba(0,0,155,0.6);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.help-button {
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.avo-button {
    border-radius: 20%;
    width: 56px;
    height: 56px;
}

.close-help,
.close-avo {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 18px;
    width: 100px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.help-popup,
.avo-popup {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
    max-width: 300px;
}

.help-content,
.avo-content {
    font-family: "Open Sans", sans-serif;
}


.hidden {
    display: none;
}

/* QR-knop */
.qr-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    border: none !important;
    outline: none !important;
    background-clip: padding-box !important;
    background: #444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.qr-button img {
    width: 24px;
    height: 24px;
}

/* Overlay */
.qr-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
    z-index: 99999;

    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.qr-overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* QR venster */
#qr-reader {
    width: 300px;
    height: 300px;
    background: white;
    padding: 10px;
    border-radius: 10px;
    overflow: hidden; /* voorkomt fullscreen */
    position: relative;
    z-index: 100000;
    cursor: pointer; /* Toont dat het klikbaar is */
    transition: transform 0.1s ease; /* Subtiele animatie */
}

#qr-reader:hover {
    transform: scale(1.02); /* Subtiele hover effect */
}

/* Wrapper voor video */
#qr-video-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Video zelf */
#qr-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;

    /* iPad anti-fullscreen fixes - verbeterd */
    position: absolute !important;
    top: 0;
    left: 0;

    max-width: 100% !important;
    max-height: 100% !important;

    transform: none !important;
    -webkit-transform: none !important;

    /* voorkomt dat iPad het video-element los trekt */
    -webkit-overflow-scrolling: auto !important;
    border-radius: 8px;

    /* Extra fullscreen preventie */
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* iOS Safari specifieke fix */
@supports (-webkit-touch-callout: none) {
    #qr-reader video {
        object-fit: cover !important;
        position: absolute !important;
    }
}





/* Mobile */
@media (max-width: 600px) {
    .audio-stop {
        padding: 0.5rem;
    }

    #audio-player {
        width: 100%;
        max-width: 800px;
        margin: 1rem auto;
        display: block;
    }

    .stop-navigation {
        grid-template-columns: 1fr auto auto 1fr;
        column-gap: 1rem;
    }

    .nav-button {
        width: 48px;
        height: 48px;
    }
}
