#htmx-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

#htmx-popup:empty {
    display: none;
}


/* Popup */

.delete-popup {
    width: 100%;
    max-width: 440px;

    padding: 32px;

    background: #fff;
    border-radius: 16px;

    text-align: center;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.20),
        0 4px 12px rgba(0, 0, 0, 0.08);

    animation: popupAppear 0.18s ease-out;
}


/* Warning icon */

.delete-popup__icon {
    width: 64px;
    height: 64px;

    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #fff1f1;
    color: #dc3545;

    font-size: 32px;
    font-weight: 700;
}

.delete-popup__icon span {
    transform: translateY(-1px);
}


/* Title */

.delete-popup__title {
    margin: 0 0 12px;

    color: #212529;

    font-size: 24px;
    font-weight: 600;
}


/* Text */

.delete-popup__text {
    margin: 0;

    color: #6c757d;

    font-size: 16px;
    line-height: 1.5;
}


/* Object name */

.delete-popup__object {
    margin: 8px 0 0;

    color: #212529;

    font-size: 17px;
    font-weight: 600;

    word-break: break-word;
}


/* Buttons */

.delete-popup__actions {
    display: flex;
    justify-content: center;
    gap: 12px;

    margin-top: 28px;
}

.delete-popup__actions button {
    min-width: 120px;
    height: 44px;

    padding: 0 20px;

    border-radius: 8px;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        transform 0.1s ease,
        box-shadow 0.15s ease;
}


/* Cancel */

.delete-popup__cancel {
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
}

.delete-popup__cancel:hover {
    background: #f8f9fa;
    border-color: #ced4da;
}


/* Delete */

.delete-popup__confirm {
    border: 1px solid #dc3545;
    background: #dc3545;
    color: #fff;
}

.delete-popup__confirm:hover {
    background: #bb2d3b;
    border-color: #b02a37;

    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.25);
}

.delete-popup__actions button:active {
    transform: scale(0.97);
}

.error-popup__detail {
    max-height: 30vh;
    overflow-y: auto;

    margin: 16px 0 0;
    padding: 12px 14px;

    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    color: #495057;

    font-size: 14px;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
}


/* Preview popup */

.preview-popup {
    width: 100%;
    max-width: 1100px;
    height: 90vh;

    display: flex;
    flex-direction: column;

    padding: 16px;

    background: #fff;
    border-radius: 16px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.20),
        0 4px 12px rgba(0, 0, 0, 0.08);

    animation: popupAppear 0.18s ease-out;
}

.preview-popup__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;

    margin-bottom: 12px;
}

.preview-popup__title {
    margin: 0;

    color: #212529;

    font-size: 18px;
    font-weight: 600;

    word-break: break-word;
}

.preview-popup__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.preview-popup__body {
    flex: 1;
    min-height: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-popup__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-popup__frame {
    width: 100%;
    height: 100%;
    border: 0;
}

.preview-popup__text {
    color: #6c757d;
    font-size: 16px;
}


/* Animation */

@keyframes popupAppear {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}


/* Mobile */

@media (max-width: 480px) {
    .delete-popup {
        padding: 26px 20px;
    }

    .delete-popup__title {
        font-size: 21px;
    }

    .delete-popup__actions {
        flex-direction: column-reverse;
    }

    .delete-popup__actions button {
        width: 100%;
    }
}
