/* Mobile-First Responsive Styles for Xan Pop-Up Rotate */

:root {
    --xan-max-w: 500px;
    --xan-radius: 12px;
}

.xan-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    padding: 16px;
}

.xan-popup-container.xan-active {
    opacity: 1;
    visibility: visible;
}

.xan-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.xan-popup-dialog {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: var(--xan-max-w);
    max-height: 90vh;
    background: #ffffff;
    border-radius: var(--xan-radius);
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35), 0 0 1px rgba(0, 0, 0, 0.2);
    transform: scale(0.92) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.xan-popup-container.xan-active .xan-popup-dialog {
    transform: scale(1) translateY(0);
}

/* Close Button (Optimized for finger touch targets on mobile) */
.xan-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    padding: 0;
    margin: 0;
    outline: none;
    transition: background 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.xan-popup-close:hover,
.xan-popup-close:focus {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.08);
}

.xan-popup-content {
    width: 100%;
    line-height: 0;
    display: block;
}

.xan-popup-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
    line-height: 0;
}

.xan-popup-media-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.xan-image-wrapper img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.xan-video-wrapper video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    display: block;
    object-fit: cover;
}

/* Very very mobile-friendly breakpoints */
@media (max-width: 600px) {
    .xan-popup-container {
        padding: 12px;
    }

    .xan-popup-dialog {
        max-width: 95vw !important;
        border-radius: min(var(--xan-radius), 14px);
    }

    .xan-popup-close {
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
        font-size: 20px;
    }

    .xan-image-wrapper img,
    .xan-video-wrapper video {
        max-height: 75vh;
    }
}

