/**
 * Frontend styles for AI Popups
 */

/* Popup overlay */
.ai-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer !important;
}

body .ai-popup-overlay,
body .ai-popup-overlay *{
    cursor: initial !important;
}
body .ai-popup-overlay button{
    cursor: pointer !important;
}

.ai-popup-overlay.ai-popup-active {
    opacity: 1;
    visibility: visible;
}

/* Popup container */
.ai-popup-container {
    position: relative;
    background: #fff;
    border-radius: 0;
    max-width: 34rem;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 1.25rem 3.125rem rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.ai-popup-overlay.ai-popup-active .ai-popup-container {
    transform: scale(1);
}

/* Close button */
.ai-popup-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 7rem;
    height: 6rem;
    padding: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
    opacity: 0;
}

.ai-popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.ai-popup-close:focus {
    outline: 0.125rem solid #fff;
    outline-offset: 0.125rem;
}

.ai-popup-close span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

/* Popup content */
.ai-popup-content {
    padding: 0;
}

.ai-popup-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.ai-popup-link:hover {
    opacity: 0.9;
}

/* Content formatting */
.ai-popup-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

.ai-popup-content p:first-child {
    margin-top: 0;
}

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

/* Prevent body scroll when popup is active */
body.ai-popup-open {
    overflow: hidden;
}

/* Responsive adjustments */
@media screen and (max-width: 48rem) {
    .ai-popup-overlay {
        padding: 0.5rem;
    }
    
    .ai-popup-container {
        max-width: 100%;
    }
    
    .ai-popup-content {
        padding: 1rem;
    }
    
    .ai-popup-close {
        width: 3.75rem;
        height: 3.75rem;
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
}

@media screen and (max-width: 30rem) {
    .ai-popup-container {
        max-height: 95vh;
    }
    
    .ai-popup-content {
        padding: 0;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .ai-popup-overlay,
    .ai-popup-container,
    .ai-popup-close,
    .ai-popup-link {
        transition: none;
    }
}

/* Print styles */
@media print {
    .ai-popup-overlay {
        display: none !important;
    }
}

