/* Hovedcontainer for galleriet */
#didak-gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    display: none;
    overflow: hidden;
}

#didak-gallery-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Hovedgalleri */
#didak-gallery {
    width: 100%;
    height: calc(99% - 12%);
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    overflow: auto;
    padding: 0px;
    box-sizing: border-box;
}

/* Generelle billedcontainer stilarter */
.image-container {
    position: relative;
    overflow: hidden;
    margin: -2px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Udvælgelsesfelt */
#didak-gallery-selection {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 12%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    overflow-x: auto;
    padding: 0px;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

#didak-gallery-selection .image-container {
    height: 100%;
    flex-shrink: 0;
    margin-right: 0px;
}

#didak-gallery-selection .image-container img {
    height: 100%;
    width: auto;
}

/* "Vis billeder" knap */
#didak-gallery-open {
    padding: 4px 16px;
    font-size: 16px;
    cursor: pointer;
    background-color: #065481;
    color: white;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#didak-gallery-open:hover {
    background-color: #093496;
}

/* Luk-knap */
#didak-gallery-close {
    position: absolute;
    top: 10px;
    right: 6px;
    width: 40px;
    height: 40px;
    background-color: red;
    color: white;
    border: none;
    border-radius: 30%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

#didak-gallery-close:hover {
    background-color: #ff3333;
}

/* Nulstil-knap */
#didak-gallery-reset {
    position: absolute;
    right: 6px;
    top: 80px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: green;
    border: none;
    border-radius: 30%;
    cursor: pointer;
    z-index: 10000;
    transition: background-color 0.3s;
}

#didak-gallery-reset:hover {
    background-color: #45a049;
}

#didak-gallery-reset::before {
    content: "";
   margin-left: -10px;
padding-bottom: 10px;
}

/* Forstørret billedvisning */
#enlarged-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5); /* transparency */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    cursor: pointer;
}

#enlarged-popup img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Animationer */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

/* Responsive design */
@media (max-width: 768px) {
    #didak-gallery-reset,
    #didak-gallery-close {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
    
    #didak-gallery-selection {
        height: 80px;
    }

    #didak-gallery-open {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Optimeret for touch-enheder */
@media (hover: none) {
    .image-container:hover img {
        transform: none;
    }
}