/* Overlay Glass Effect */
.ges-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 18, 24, 0.65);
    /* Richer dark overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    /* Use visibility for smoother transition */
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.4s;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.ges-popup-overlay.ges-show {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.ges-popup-container {
    position: relative;
    width: 90%;
    max-width: 850px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 1px rgba(0, 0, 0, 0.1);
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease-out;
    /* Spring effect */
    display: flex;
    flex-direction: row;
    overflow: hidden;
    /* Keep image inside radius */
}

.ges-popup-overlay.ges-show .ges-popup-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Close Button */
.ges-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    color: #4a5568;
    z-index: 20;
    transition: all 0.2s ease;
}

.ges-popup-close:hover {
    background: #f7fafc;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #2d3748;
    /* Darker on hover */
}

/* Close button style for image-only popups (since it might be over a dark image) */
.ges-image-only+.ges-popup-close,
/* If we move it inside later */
.ges-popup-container:has(.ges-image-only) .ges-popup-close {
    background: rgba(255, 255, 255, 0.8);
    color: #000;
}

/* Content Wrapper */
.ges-popup-content-wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Image Section */
.ges-popup-close svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.ges-popup-image {
    width: 45%;
    background-size: cover;
    background-position: center center;
    min-height: 350px;
    position: relative;
}

.ges-popup-image::after {
    /* Subtle inner shadow for depth */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.02), transparent);
}

/* Text Section */
.ges-popup-text {
    width: 55%;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    color: #2d3748;
}

/* No Image Layout */
.ges-popup-content-wrapper:not(.has-image) .ges-popup-text {
    width: 100%;
    text-align: center;
    padding: 60px 40px;
}

.ges-popup-text h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.ges-popup-body {
    font-size: 1.05rem;
    line-height: 1.65;
    color: #4a5568;
    font-weight: 400;
}

.ges-popup-body p {
    margin-bottom: 1rem;
}

.ges-popup-body p:last-child {
    margin-bottom: 0;
}

/* Image Only Layout */
.ges-popup-full-img {
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.ges-popup-content-wrapper.ges-image-only {
    width: auto;
    background: transparent;
}

/* Remove old overrides if any left */
.ges-popup-content-wrapper.ges-image-only .ges-popup-image {
    display: none;
}

.ges-popup-content-wrapper.ges-image-only .ges-popup-text {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .ges-popup-container {
        flex-direction: column;
        width: 92%;
        max-width: 400px;
        /* Nicer mobile width */
        max-height: 90vh;
        /* Prevent overflow */
        overflow-y: auto;
        /* Allow scroll if tall */
    }

    .ges-popup-content-wrapper {
        flex-direction: column;
    }

    .ges-popup-image {
        width: 100%;
        height: 220px;
        min-height: auto;
    }

    .ges-popup-text {
        width: 100%;
        padding: 30px 24px;
        text-align: center;
    }

    .ges-popup-close {
        top: 12px;
        right: 12px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(4px);
    }
}