/* Stylowanie popupu */
#my-popup {
    display: none;
    background: none; /* Usunięcie tła */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    width: auto; /* Dopasowanie szerokości */
    height: auto; /* Dopasowanie wysokości */
}

#my-popup img {
    display: block;
    max-width: 100%; /* Domyślnie ograniczenie szerokości */
    width: auto; /* Dopasowanie do obrazka */
    height: auto; /* Dopasowanie do obrazka */
    margin: 0;
}

#my-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7); /* Przyciemnione tło */
    z-index: 9998; /* Tło musi być poniżej popupu */
    opacity: 1;
    transition: opacity 0.5s ease;
}

#my-popup-overlay.closing {
    opacity: 0;
}

#my-popup-close {
    position: absolute;
    top: -10px;
    right: -10px;
    cursor: pointer;
    font-size: 18px;
    background: #fff; /* Tło krzyżyka */
    border: 1px solid #000; /* Obwódka krzyżyka */
    border-radius: 50%; /* Kółko */
    width: 30px; /* Szerokość */
    height: 30px; /* Wysokość */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000; /* Kolor krzyżyka */
    z-index: 10000;
}

#my-popup-close:hover {
    background: #000; /* Zmiana koloru na hover */
    color: #fff; /* Kolor krzyżyka na hover */
    border-color: #fff;
}

/* Dostosowanie mobilne */
@media screen and (max-width: 768px) {
    #my-popup img {
        max-width: 95vw; /* Dopasowanie szerokości do ekranu */
        height: auto; /* Zachowanie proporcji */
    }
}

/* Dostosowanie dla bardzo małych ekranów */
@media screen and (max-width: 480px) {
    #my-popup img {
        max-width: 90vw; /* Jeszcze mniejsze zdjęcie na bardzo małych ekranach */
    }
}

/* Dostosowanie dla dużych ekranów */
@media screen and (min-width: 1024px) {
    #my-popup img {
        max-height: 90vh; /* Ograniczenie wysokości dla dużych ekranów */
    }
}

/* Dostosowanie dla urządzeń dotykowych */
@media screen and (max-width: 768px) and (pointer: coarse) {
    #my-popup-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Bazowy styl dla popup-content */
.popup-content {
    position: relative;
    display: inline-block;
}

/* Efekty animacji */
.popup-content.fade {
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

.popup-content.zoom {
    animation: zoomIn 0.5s forwards;
}

.popup-content.slide-down {
    transform: translateY(-150vh);
    animation: slideDown 0.5s forwards;
}

.popup-content.slide-left {
    transform: translateX(-150vw);
    animation: slideLeft 0.5s forwards;
}

.popup-content.slide-right {
    transform: translateX(150vw);
    animation: slideRight 0.5s forwards;
}

/* Animacje zamykania */
.popup-content.fade.closing {
    animation: fadeOut 0.5s forwards;
}

.popup-content.zoom.closing {
    animation: zoomOut 0.5s forwards;
}

.popup-content.slide-down.closing {
    animation: slideUp 0.5s forwards;
}

.popup-content.slide-left.closing {
    animation: slideOutLeft 0.5s forwards;
}

.popup-content.slide-right.closing {
    animation: slideOutRight 0.5s forwards;
}

/* Klucze animacji - otwieranie */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.5); }
    to { transform: scale(1); }
}

@keyframes slideDown {
    to { transform: translateY(0); }
}

@keyframes slideLeft {
    to { transform: translateX(0); }
}

@keyframes slideRight {
    to { transform: translateX(0); }
}

/* Klucze animacji - zamykanie */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes zoomOut {
    from { transform: scale(1); }
    to { transform: scale(0.5); opacity: 0; }
}

@keyframes slideUp {
    from { transform: translateY(0); }
    to { transform: translateY(-150vh); }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); }
    to { transform: translateX(-150vw); }
}

@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(150vw); }
}
