/* Popup Overlay Background */
.custom-ai-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* Open states */
.custom-ai-popup-overlay.custom-ai-popup-open {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Container */
.custom-ai-popup-container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 550px;
    position: relative;
    padding: 40px;
    box-sizing: border-box;
    transform: scale(0.85) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333333;
}

.custom-ai-popup-overlay.custom-ai-popup-open .custom-ai-popup-container {
    transform: scale(1) translateY(0);
}

/* Close button style */
.custom-ai-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    font-weight: 300;
    color: #888888;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.custom-ai-popup-close:hover {
    color: #333333;
}

/* Popup Body content spacing */
.custom-ai-popup-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.custom-ai-popup-title {
    font-size: 28px;
    font-weight: 700;
    color: #111111;
    margin: 0 0 15px 0;
    line-height: 1.25;
}

.custom-ai-popup-desc {
    font-size: 16px;
    line-height: 1.6;
    color: #555555;
    margin-bottom: 25px;
    width: 100%;
}

.custom-ai-popup-desc p {
    margin: 0 0 15px 0;
}

.custom-ai-popup-desc p:last-child {
    margin-bottom: 0;
}

.custom-ai-popup-desc ul, .custom-ai-popup-desc ol {
    text-align: left;
    margin-left: 20px;
}

/* CTA button style */
.custom-ai-popup-action {
    width: 100%;
    margin-top: 10px;
}

.custom-ai-popup-btn {
    display: inline-block;
    background-color: #c50f3c; /* Matches site branding */
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 8px;
    transition: background-color 0.25s ease, transform 0.15s ease;
    box-shadow: 0 4px 10px rgba(197, 15, 60, 0.2);
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
    max-width: 320px;
}

.custom-ai-popup-btn:hover {
    background-color: #a60c32;
    color: #ffffff;
}

.custom-ai-popup-btn:active {
    transform: scale(0.98);
}

/* Accessibility */
.custom-ai-popup-close:focus,
.custom-ai-popup-btn:focus {
    outline: 2px solid #c50f3c;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .custom-ai-popup-container {
        padding: 30px 20px 30px 20px;
        width: 92%;
    }
    
    .custom-ai-popup-title {
        font-size: 22px;
    }
    
    .custom-ai-popup-desc {
        font-size: 14px;
    }
}
