/**
 * Popup Styles (Non-critical)
 * Critical CSS is inlined in the popup template
 *
 * @package Conversion_Intelligence_Pro
 */

/* ============================================
   Additional Popup Enhancements
   ============================================ */

/* Image hover effects */
.cip-popup__image img {
    transition: transform 0.5s ease;
}

.cip-popup__image:hover img {
    transform: scale(1.02);
}

/* CTA button enhanced animations */
.cip-popup__cta {
    position: relative;
    overflow: hidden;
}

.cip-popup__cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cip-popup__cta:active::before {
    width: 300px;
    height: 300px;
}

/* Shimmer effect on CTA */
.cip-popup__cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: cip-shimmer 3s infinite;
}

@keyframes cip-shimmer {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 150%;
    }
}

/* Close button hover enhancement */
.cip-popup__close::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: transparent;
    transition: background-color 0.2s;
}

.cip-popup__close:hover::before {
    background: rgba(0, 0, 0, 0.05);
}

.cip-popup--dark .cip-popup__close:hover::before {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Alternative Color Themes
   ============================================ */

/* Blue theme */
.cip-popup--theme-blue .cip-popup__cta {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.cip-popup--theme-blue .cip-popup__cta:hover {
    box-shadow: 0 10px 20px -5px rgba(14, 165, 233, 0.4);
}

/* Green theme */
.cip-popup--theme-green .cip-popup__cta {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.cip-popup--theme-green .cip-popup__cta:hover {
    box-shadow: 0 10px 20px -5px rgba(34, 197, 94, 0.4);
}

/* Purple theme */
.cip-popup--theme-purple .cip-popup__cta {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.cip-popup--theme-purple .cip-popup__cta:hover {
    box-shadow: 0 10px 20px -5px rgba(168, 85, 247, 0.4);
}

/* Orange theme */
.cip-popup--theme-orange .cip-popup__cta {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.cip-popup--theme-orange .cip-popup__cta:hover {
    box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.4);
}

/* Red theme */
.cip-popup--theme-red .cip-popup__cta {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.cip-popup--theme-red .cip-popup__cta:hover {
    box-shadow: 0 10px 20px -5px rgba(239, 68, 68, 0.4);
}

/* ============================================
   Position Variants
   ============================================ */

/* Bottom bar style */
.cip-popup--bar-bottom {
    align-items: flex-end;
    padding: 0;
}

.cip-popup--bar-bottom .cip-popup__container {
    max-width: 100%;
    width: 100%;
    border-radius: 0;
    margin: 0;
}

.cip-popup--bar-bottom .cip-popup__image {
    display: none;
}

.cip-popup--bar-bottom .cip-popup__content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px;
    text-align: left;
}

.cip-popup--bar-bottom .cip-popup__headline {
    margin: 0;
    font-size: 1.1rem;
}

.cip-popup--bar-bottom .cip-popup__body {
    margin: 0;
}

.cip-popup--bar-bottom .cip-popup__cta {
    width: auto;
    padding: 10px 24px;
}

.cip-popup--bar-bottom .cip-popup__dismiss {
    display: none;
}

.cip-popup--bar-bottom .cip-popup__footer {
    display: none;
}

.cip-popup--bar-bottom .cip-popup__close {
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
}

/* Slide-in side panel */
.cip-popup--side-right {
    justify-content: flex-end;
    padding: 0;
}

.cip-popup--side-right .cip-popup__container {
    height: 100vh;
    max-height: 100vh;
    max-width: 400px;
    border-radius: 0;
    margin: 0;
}

.cip-popup--side-right .cip-popup__image {
    aspect-ratio: 4 / 3;
    border-radius: 0;
}

/* Full screen takeover */
.cip-popup--fullscreen .cip-popup__container {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.cip-popup--fullscreen .cip-popup__image {
    flex: 1;
    aspect-ratio: auto;
    border-radius: 0;
}

.cip-popup--fullscreen .cip-popup__content {
    padding: 32px;
}

/* ============================================
   Loading States
   ============================================ */

.cip-popup--loading .cip-popup__image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: cip-skeleton 1.5s infinite;
}

.cip-popup--loading .cip-popup__headline,
.cip-popup--loading .cip-popup__body {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: cip-skeleton 1.5s infinite;
    color: transparent;
    border-radius: 4px;
}

@keyframes cip-skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   Custom Scrollbar
   ============================================ */

.cip-popup__container::-webkit-scrollbar {
    width: 8px;
}

.cip-popup__container::-webkit-scrollbar-track {
    background: transparent;
}

.cip-popup__container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.cip-popup__container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.cip-popup--dark .cip-popup__container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.cip-popup--dark .cip-popup__container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .cip-popup {
        display: none !important;
    }
}

/* ============================================
   High Contrast Mode
   ============================================ */

@media (prefers-contrast: high) {
    .cip-popup__container {
        border: 2px solid currentColor;
    }
    
    .cip-popup__cta {
        border: 2px solid transparent;
    }
    
    .cip-popup__cta:focus-visible {
        outline: 3px solid currentColor;
        outline-offset: 3px;
    }
    
    .cip-popup__close {
        border: 2px solid currentColor;
    }
}

/* ============================================
   Forced Colors Mode (Windows High Contrast)
   ============================================ */

@media (forced-colors: active) {
    .cip-popup__cta {
        forced-color-adjust: none;
        background: ButtonFace;
        color: ButtonText;
        border: 2px solid ButtonText;
    }
    
    .cip-popup__cta:hover,
    .cip-popup__cta:focus {
        background: Highlight;
        color: HighlightText;
    }
    
    .cip-popup__close {
        background: ButtonFace;
        border: 1px solid ButtonText;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .cip-popup__cta::after {
        animation: none;
    }
    
    .cip-popup__image img {
        transition: none;
    }
    
    .cip-popup--loading .cip-popup__image,
    .cip-popup--loading .cip-popup__headline,
    .cip-popup--loading .cip-popup__body {
        animation: none;
        background: #e0e0e0;
    }
}
