@import url('../../assets/css/variables.css');

/** START POPUP **/

/* Backdrop */
.ba-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.ba-popup:not([hidden]) {
    display: flex;
}

.ba-popup__backdrop {
    position: absolute;
    inset: 0;
    background-color: #000000bd;
    cursor: pointer;
}

/* Dialog */
.ba-popup__dialog {
    position: relative;
    background-color: var(--color-bg-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;

    /* Entry animation */
    animation: ba-popup-in var(--transition-normal) ease both;
}

@keyframes ba-popup-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button */
.ba-popup__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    z-index: 2;

    /* Gradient border via background trick */
    border: none;
    outline: none;
}

/* Gradient border using a pseudo-element ring */
.ba-popup__close::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 1px;
    background: linear-gradient(135deg, #89B7DD 0%, #B1D786 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

.ba-popup__close:hover {
    background-color: var(--color-bg-light);
}

/* Body */
.ba-popup__body {
    padding: 60px;
    background-color: var(--color-bg-white);
}

/* Scroll lock on body when popup is open */
body.ba-popup-open {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .ba-popup__body {
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .ba-popup {
        padding: var(--space-4);
        align-items: center;
    }

    .ba-popup__dialog {
        width: 95vw;
        max-width: 95vw;
        max-height: 92vh;
    }

    .ba-popup__body {
        padding: 80px 20px 40px;
    }
}

/** END POPUP **/
