/* Allo Elementor Widgets - Popup Widget Styles */

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Popup Content Container */
.popup-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
    outline: none;
}

.popup-content:focus {
    outline: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding:0px;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.popup-close:focus {
    outline: none;
    box-shadow: 0 0 0 2px #00A1AD, 0 4px 12px rgba(0, 0, 0, 0.15);
}

.popup-close svg {
    width: 24px;
    height: 24px;
    color: #333;
    stroke-width: 2.5;
}

/* Popup Body Layout */
.popup-body {
    display: flex;
    min-height: 300px;
}

/* Left Side - Image */
.popup-image {
    flex: 0 0 40%;
    background: linear-gradient(135deg, #00A1AD 0%, #0085a3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Right Side - Content */
.popup-text-content {
    flex: 1;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

/* Text Styling */
.popup-text {
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    margin-bottom: 25px;
    font-weight: 400;
}

/* CTA Button - Matching the main site CTA buttons */
.popup-cta-button {
    background: #00A1AD;
    color: #FFFFFF;
    padding: 10px 30px;
    border: 2px solid #00A1AD;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 161, 173, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 180px;
    text-align: center;
}

.popup-cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.popup-cta-button:hover::before {
    left: 100%;
}

.popup-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 161, 173, 0.4);
    background: #FFFFFF;
    color: #00A1AD;
    border: 2px solid #00A1AD;
}

.popup-cta-button:active {
    transform: translateY(-1px);
}

.popup-cta-button:focus {
    outline: 2px solid rgba(0, 161, 173, 0.5);
    outline-offset: 2px;
}

/* Body class when popup is open */
body.popup-open {
    overflow: hidden;
}

/* Dark Mode Styles */
.allo-popup-widget.dark-mode .popup-content {
    background: #2a2a2a;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.allo-popup-widget.dark-mode .popup-overlay {
    background: rgba(0, 0, 0, 0.8);
}

.allo-popup-widget.dark-mode .popup-text,
.allo-popup-widget.dark-mode .popup-text-en,
.allo-popup-widget.dark-mode .popup-text-fr,
.allo-popup-widget.dark-mode .popup-text-content {
    color: #e8f4f8 !important;
}

.allo-popup-widget.dark-mode .popup-close {
    background: rgba(42, 42, 42, 0.9);
    color: #e8f4f8;
}

.allo-popup-widget.dark-mode .popup-close:hover {
    background: rgba(42, 42, 42, 1);
}

.allo-popup-widget.dark-mode .popup-close svg {
    color: #e8f4f8;
}

.allo-popup-widget.dark-mode .popup-image {
    background: linear-gradient(135deg, #004f57 0%, #003a42 100%);
}

/* Dark Mode CTA Button - Matching main site */
.allo-popup-widget.dark-mode .popup-cta-button {
    background: #FFFFFF;
    color: #00A1AD;
    border: 2px solid #FFFFFF;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.allo-popup-widget.dark-mode .popup-cta-button:hover {
    background: #00A1AD;
    color: #FFFFFF;
    border: 2px solid #00A1AD;
    box-shadow: 0 8px 25px rgba(0, 161, 173, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .popup-content {
        width: 95vw;
        max-width: none;
        margin: 20px;
    }
    
    .popup-body {
        flex-direction: column;
        min-height: auto;
    }
    
    .popup-image {
        flex: 0 0 200px;
        width: 100%;
    }
    
    .popup-text-content {
        padding: 30px 25px;
    }
    
    .popup-text {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .popup-cta-button {
        padding: 12px 24px;
        font-size: 14px;
        min-width: 160px;
    }
    
    .popup-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .popup-close svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .popup-content {
        width: 98vw;
        margin: 10px;
        border-radius: 12px;
    }
    
    .popup-image {
        flex: 0 0 150px;
    }
    
    .popup-text-content {
        padding: 25px 20px;
    }
    
    .popup-text {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 18px;
    }
    
    .popup-cta-button {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 140px;
        border-radius: 40px;
    }
    
    .popup-close {
        right: 12px;
        width: 36px;
        height: 36px;
    }
    
    .popup-close svg {
        width: 18px;
        height: 18px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .popup-content {
        border: 2px solid #000;
    }
    
    .popup-close {
        border: 1px solid #333;
    }
    
    .popup-cta-button {
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .popup-overlay,
    .popup-content,
    .popup-close,
    .popup-cta-button {
        animation: none;
        transition: none;
    }
    
    .popup-cta-button:hover {
        transform: none;
    }
}

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

/* Focus trap for accessibility */
.popup-overlay:focus-within .popup-content {
    outline: 2px solid #00A1AD;
    outline-offset: 4px;
}

/* Loading state for image */
.popup-image img {
    transition: opacity 0.3s ease;
}

.popup-image img:not([src]),
.popup-image img[src=""] {
    opacity: 0;
}

/* Hover effects for better interactivity */
.popup-text-content {
    position: relative;
}

.popup-text-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #00A1AD, #E84E4E);
    border-radius: 2px;
    opacity: 0.3;
}

/* Animation for text appearance */
.popup-text {
    animation: textFadeIn 0.6s ease-out 0.2s both;
}

.popup-cta-button {
    animation: buttonSlideIn 0.6s ease-out 0.4s both;
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes buttonSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Ensure proper stacking */
.popup-overlay * {
    box-sizing: border-box;
}

/* Smooth scrolling for overflow content */
.popup-content {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00A1AD #f1f1f1;
}

.popup-content::-webkit-scrollbar {
    width: 6px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #00A1AD;
    border-radius: 3px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #0085a3;
}