/* Social Proof Popups Frontend Styles */

/* Popup Container */
.spp-popup-container {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
}

/* Position variations */
.spp-popup-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.spp-popup-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

.spp-popup-container.top-right {
    top: 20px;
    right: 20px;
}

.spp-popup-container.top-left {
    top: 20px;
    left: 20px;
}

/* Popup Base */
.spp-popup {
    position: relative;
    width: 320px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-out;
}

.spp-popup.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Popup Inner */
.spp-popup-inner {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

/* Popup Image */
.spp-popup-image {
    flex-shrink: 0;
}

.spp-popup-image img {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    object-fit: cover;
}

/* Popup Content */
.spp-popup-content {
    flex: 1;
    min-width: 0;
}

.spp-popup-headline {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spp-popup-subheading {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #666666;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Close Button */
.spp-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: #666;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
}

.spp-popup:hover .spp-popup-close {
    opacity: 1;
}

.spp-popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
}

.spp-popup-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: -2px;
}

/* Animation Styles */
/* Slide + Fade (default) */
.spp-popup.animation-slide-fade {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.spp-popup.animation-slide-fade.entering {
    opacity: 0;
    transform: translateY(20px);
}

.spp-popup.animation-slide-fade.exiting {
    opacity: 0;
    transform: translateY(10px);
}

/* Fade only */
.spp-popup.animation-fade {
    transition: opacity 0.3s ease-out;
    transform: none !important;
}

.spp-popup.animation-fade.entering {
    opacity: 0;
}

.spp-popup.animation-fade.exiting {
    opacity: 0;
}

/* Slide only */
.spp-popup.animation-slide {
    transition: transform 0.3s ease-out;
}

.spp-popup.animation-slide.entering {
    transform: translateX(100%);
}

.spp-popup.animation-slide.exiting {
    transform: translateX(100%);
}

/* Bounce */
.spp-popup.animation-bounce.visible {
    animation: sppBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes sppBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(20px);
    }
    50% {
        transform: scale(1.05) translateY(0);
    }
    70% {
        transform: scale(0.95) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Popup Types */
/* Award Type */
.spp-popup.spp-type-award {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.spp-popup.spp-type-award .spp-popup-headline {
    color: #92400e;
}

.spp-popup.spp-type-award .spp-popup-subheading {
    color: #b45309;
}

/* Mobile Styles */
@media (max-width: 480px) {
    .spp-popup-container.bottom-right,
    .spp-popup-container.bottom-left {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .spp-popup-container.top-right,
    .spp-popup-container.top-left {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .spp-popup {
        width: 100%;
        max-width: none;
    }
    
    /* Reduced mobile display */
    .spp-mobile-reduced .spp-popup-inner {
        padding: 12px;
    }
    
    .spp-mobile-reduced .spp-popup-image img {
        width: 48px;
        height: 48px;
    }
    
    .spp-mobile-reduced .spp-popup-headline {
        font-size: 14px;
    }
    
    .spp-mobile-reduced .spp-popup-subheading {
        font-size: 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .spp-popup {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .spp-popup {
        border: 2px solid currentColor;
    }
    
    .spp-popup-close {
        background: #000;
        color: #fff;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .spp-popup {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .spp-popup-headline {
        color: #ffffff;
    }
    
    .spp-popup-subheading {
        color: #cccccc;
    }
    
    .spp-popup-close {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    .spp-popup-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}