/* Social Proof Popup Styles */

:root {
    --spp-theme-color: #e02b20;
    --spp-theme-color-light: #e02b20;
}

#spp-container {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Position: Left (default) */
#spp-container.spp-position-left {
    left: 20px;
    right: auto;
}

/* Position: Right */
#spp-container.spp-position-right {
    right: 20px;
    left: auto;
}

.spp-popup {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
    padding: 16px;
    max-width: 340px;
    min-width: 280px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    touch-action: pan-x pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.spp-popup.spp-swiping {
    transition: none !important;
}

/* Animation for left position */
#spp-container.spp-position-left .spp-popup {
    transform: translateX(-100%) scale(0.9);
}

#spp-container.spp-position-left .spp-popup.spp-show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

#spp-container.spp-position-left .spp-popup.spp-hide {
    opacity: 0;
    transform: translateX(-100%) scale(0.9);
}

/* Animation for right position */
#spp-container.spp-position-right .spp-popup {
    transform: translateX(100%) scale(0.9);
}

#spp-container.spp-position-right .spp-popup.spp-show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

#spp-container.spp-position-right .spp-popup.spp-hide {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
}

.spp-popup-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.spp-icon {
    width: 48px;
    height: 48px;
    background: var(--spp-theme-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.spp-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.spp-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #333333;
}

.spp-text strong {
    font-weight: 600;
    color: #1a1a1a;
}

.spp-meta {
    font-size: 12px;
    color: #888888;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.spp-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.spp-location::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E");
    background-size: contain;
}

.spp-location::after {
    content: "\2022";
    color: #cccccc;
    margin-left: 2px;
}

.spp-time {
    color: #999999;
}

.spp-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #cccccc;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spp-close:hover {
    color: #666666;
    background: rgba(0, 0, 0, 0.05);
}

/* Verified badge */
.spp-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #4CAF50;
    margin-top: 2px;
}

.spp-verified::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234CAF50'%3E%3Cpath d='M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z'/%3E%3C/svg%3E");
    background-size: contain;
}

/* Pulse animation for the icon */
@keyframes spp-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--spp-theme-color-alpha, rgba(224, 43, 32, 0.4));
    }
    70% {
        box-shadow: 0 0 0 10px rgba(224, 43, 32, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(224, 43, 32, 0);
    }
}

.spp-popup.spp-show .spp-icon {
    animation: spp-pulse 2s infinite;
}

/* Product popup styles */
a.spp-popup.spp-product-popup {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer !important;
}

a.spp-popup.spp-product-popup:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18), 0 6px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px) !important;
}

a.spp-popup.spp-product-popup .spp-product-name {
    color: var(--spp-theme-color);
    transition: text-decoration 0.2s ease;
}

a.spp-popup.spp-product-popup:hover .spp-product-name {
    text-decoration: underline;
}

.spp-product-image {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.spp-product-name {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.spp-product-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--spp-theme-color);
    margin-top: 2px;
}

.spp-product-price del {
    color: #999;
    font-weight: 400;
    font-size: 11px;
    margin-right: 4px;
}

.spp-product-price ins {
    text-decoration: none;
}

/* Tablet responsive */
@media (max-width: 768px) {
    #spp-container {
        bottom: 15px;
    }

    #spp-container.spp-position-left {
        left: 15px;
    }

    #spp-container.spp-position-right {
        right: 15px;
    }

    .spp-popup {
        max-width: 300px;
        min-width: 240px;
        padding: 12px;
    }

    .spp-popup-content {
        gap: 10px;
    }

    .spp-icon {
        width: 40px;
        height: 40px;
    }

    .spp-icon svg {
        width: 20px;
        height: 20px;
    }

    .spp-text {
        font-size: 13px;
    }

    .spp-meta {
        font-size: 11px;
    }

    .spp-product-image {
        width: 48px;
        height: 48px;
    }

    .spp-product-name {
        font-size: 12px;
    }

    .spp-product-price {
        font-size: 12px;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    #spp-container {
        bottom: 12px;
    }

    #spp-container.spp-position-left {
        left: 10px;
        right: auto;
        max-width: calc(100vw - 70px);
    }

    #spp-container.spp-position-right {
        right: 10px;
        left: auto;
        max-width: calc(100vw - 70px);
    }

    .spp-popup {
        max-width: 320px;
        min-width: 260px;
        padding: 12px 14px;
        border-radius: 8px;
    }

    .spp-popup-content {
        gap: 10px;
    }

    .spp-icon {
        width: 36px;
        height: 36px;
    }

    .spp-icon svg {
        width: 18px;
        height: 18px;
    }

    .spp-text {
        font-size: 13px;
        line-height: 1.4;
    }

    .spp-meta {
        font-size: 10px;
        margin-top: 3px;
        gap: 4px;
    }

    .spp-verified {
        font-size: 9px;
        margin-top: 2px;
    }

    .spp-verified::before {
        width: 10px;
        height: 10px;
    }

    .spp-close {
        top: 4px;
        right: 4px;
        width: 20px;
        height: 20px;
        font-size: 14px;
    }

    .spp-product-image {
        width: 44px;
        height: 44px;
        border-radius: 6px;
    }

    .spp-product-name {
        font-size: 12px;
        max-width: 160px;
    }

    .spp-product-price {
        font-size: 12px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    #spp-container.spp-position-left,
    #spp-container.spp-position-right {
        max-width: calc(100vw - 60px);
    }

    .spp-popup {
        max-width: 280px;
        min-width: 220px;
        padding: 10px 12px;
    }

    .spp-icon {
        width: 32px;
        height: 32px;
    }

    .spp-icon svg {
        width: 16px;
        height: 16px;
    }

    .spp-text {
        font-size: 12px;
    }

    .spp-meta {
        font-size: 9px;
    }

    .spp-product-image {
        width: 40px;
        height: 40px;
    }

    .spp-product-name {
        font-size: 11px;
        max-width: 140px;
    }

    .spp-product-price {
        font-size: 11px;
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .spp-popup {
        transition: opacity 0.2s ease;
        transform: none !important;
    }

    .spp-popup.spp-show {
        transform: none !important;
    }

    .spp-popup.spp-hide {
        transform: none !important;
    }

    .spp-popup.spp-show .spp-icon {
        animation: none;
    }
}
