/**
 * Frontend CSS pro Humanit Pop-up Modal
 */

/* Modal styling */
#hpmPopupModal .modal-content {
    border-radius: 8px;
    overflow: hidden;
}

#hpmPopupModal .modal-body {
    padding: 0;
    position: relative;
}

/* Zavírací tlačítko */
#hpmPopupModal .btn-close {
    z-index: 1060;
    width: 35px;
    height: 35px;
    opacity: 0.9;
    transition: opacity 0.2s, transform 0.2s;
}

#hpmPopupModal .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Obrázek v modalu */
.hpm-modal-image {
    display: block;
    max-width: 600px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    cursor: pointer;
    transition: opacity 0.2s;
}

.hpm-modal-image:hover {
    opacity: 0.95;
}

/* Modal body link */
#hpmPopupModal .modal-body a {
    display: block;
    line-height: 0;
}

#hpmPopupModal .modal-body a:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

/* Fixed tlačítko pro znovuotevření */
.hpm-reopen-button {
    position: fixed;
    bottom: 20px;
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
}

/* Pozice tlačítka */
.hpm-button-right {
    right: 20px;
}

.hpm-button-left {
    left: 20px;
}

/* Hover efekt */
.hpm-reopen-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.hpm-reopen-button:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Modal na mobilu */
    #hpmPopupModal .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    #hpmPopupModal .modal-content {
        border-radius: 6px;
    }

    /* Zavírací tlačítko na mobilu */
    #hpmPopupModal .btn-close {
        width: 30px;
        height: 30px;
        margin: 8px !important;
    }

    /* Fixed tlačítko na mobilu */
    .hpm-reopen-button {
        bottom: 15px;
        padding: 10px 20px;
        font-size: 14px;
    }

    .hpm-button-right {
        right: 15px;
    }

    .hpm-button-left {
        left: 15px;
    }

    /* Skrýt tlačítko na mobilu pokud je nastaveno */
    .hpm-reopen-button.hpm-hide-mobile {
        display: none !important;
    }
}

@media (max-width: 576px) {
    /* Extra malé obrazovky */
    #hpmPopupModal .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }

    .hpm-reopen-button {
        bottom: 10px;
        padding: 8px 16px;
        font-size: 13px;
    }

    .hpm-button-right {
        right: 10px;
    }

    .hpm-button-left {
        left: 10px;
    }
}

/* Animace při načtení modalu */
#hpmPopupModal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}

#hpmPopupModal.show .modal-dialog {
    transform: none;
}

/* Backdrop styling
#hpmPopupModal.modal {
   backdrop-filter: blur(2px);
}

#hpmPopupModal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}
 */

/* Disable Bootstrap backdrop - Layer 1: Hide backdrop completely */
.modal-backdrop,
.offcanvas-backdrop {
    display: none !important;
}

/* Disable Bootstrap backdrop - Layer 2: Transparent fallback */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0) !important;
}

.offcanvas-backdrop {
    background-color: rgba(0, 0, 0, 0) !important;
}

/* Přístupnost - focus styling */
.hpm-reopen-button:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Offcanvas styling (mobile) */
#hpmPopupOffcanvas {
    height: auto;
    max-height: 85vh;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
}

#hpmPopupOffcanvas .offcanvas-header {
    padding: 12px 16px;
    border-bottom: none;
    min-height: 48px;
    justify-content: end;
}

#hpmPopupOffcanvas .btn-close {
    margin: 0;
    padding: 0;
    width: 30px;
    height: 30px;
    opacity: 0.9;
    transition: opacity 0.2s, transform 0.2s;
}

#hpmPopupOffcanvas .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

#hpmPopupOffcanvas .offcanvas-body {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Obrázek v offcanvas */
.hpm-offcanvas-image {
    display: block;
    max-width: 600px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    cursor: pointer;
    transition: opacity 0.2s;
}

.hpm-offcanvas-image:hover {
    opacity: 0.95;
}

/* Offcanvas body link */
#hpmPopupOffcanvas .offcanvas-body a {
    display: block;
    line-height: 0;
}

#hpmPopupOffcanvas .offcanvas-body a:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

/* Print media - skrýt modal a offcanvas při tisku */
@media print {
    #hpmPopupModal,
    #hpmPopupOffcanvas,
    .hpm-reopen-button,
    .modal-backdrop,
    .offcanvas-backdrop {
        display: none !important;
    }
}
