/* Social Proof Popup Styles */

/* Base popup styles */
.social-proof-popup {
    position: fixed;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 16px 20px;
    z-index: 9999;
    max-width: 400px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.social-proof-popup.show {
    opacity: 1;
    transform: translateY(0);
}

.social-proof-popup.hide {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Desktop positioning */
@media (min-width: 768px) {
    /* Bottom Left (default) */
    .social-proof-popup.position-bottom-left {
        bottom: 20px;
        left: 20px;
        width: auto;
        min-width: 320px;
    }
    
    /* Bottom Right */
    .social-proof-popup.position-bottom-right {
        bottom: 20px;
        right: 20px;
        left: auto;
        width: auto;
        min-width: 320px;
    }
    
    /* Top Left */
    .social-proof-popup.position-top-left {
        top: 20px;
        bottom: auto;
        left: 20px;
        width: auto;
        min-width: 320px;
    }
    
    /* Top Right */
    .social-proof-popup.position-top-right {
        top: 20px;
        bottom: auto;
        right: 20px;
        left: auto;
        width: auto;
        min-width: 320px;
    }
    
    /* Fallback - if no position class */
    .social-proof-popup:not([class*="position-"]) {
        bottom: 20px;
        left: 20px;
        width: auto;
        min-width: 320px;
    }
}

/* Mobile positioning */
@media (max-width: 767px) {
    /* Bottom positions - full width at bottom */
    .social-proof-popup.position-bottom-left,
    .social-proof-popup.position-bottom-right {
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        position: fixed;
        z-index: 9999;
    }
    
    /* Top positions - full width at top */
    .social-proof-popup.position-top-left,
    .social-proof-popup.position-top-right {
        top: 0;
        bottom: auto;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        position: fixed;
        z-index: 9999;
    }
    
    /* Animation for bottom positions */
    .social-proof-popup.position-bottom-left.show,
    .social-proof-popup.position-bottom-right.show {
        transform: translateY(0);
    }
    
    .social-proof-popup.position-bottom-left.hide,
    .social-proof-popup.position-bottom-right.hide {
        transform: translateY(100%);
    }
    
    /* Animation for top positions */
    .social-proof-popup.position-top-left.show,
    .social-proof-popup.position-top-right.show {
        transform: translateY(0);
    }
    
    .social-proof-popup.position-top-left.hide,
    .social-proof-popup.position-top-right.hide {
        transform: translateY(-100%);
    }
    
    /* Fallback - if no position class, default to bottom */
    .social-proof-popup:not([class*="position-"]) {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        position: fixed;
        z-index: 9999;
    }
    
    .social-proof-popup.show {
        transform: translateY(0);
    }
    
    .social-proof-popup.hide {
        transform: translateY(100%);
    }
}

/* Close button */
.social-proof-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 16px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-proof-close:hover {
    color: #6b7280;
    background-color: #f3f4f6;
}

/* Popup content */
.social-proof-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 20px;
}

.social-proof-flag {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.social-proof-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #374151;
    font-weight: 500;
}

.social-proof-time {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
    margin-top: 2px;
    font-style: italic;
}

/* Success icon for purchase popup */
.social-proof-success {
    background: #10b981;
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* Viewing popup specific styles */
.social-proof-popup.viewing-popup .social-proof-content {
    align-items: flex-start;
}

.social-proof-popup.viewing-popup .social-proof-text {
    font-size: 14px;
    color: #1f2937;
}

.social-proof-popup.viewing-popup .social-proof-text strong {
    color: #374151;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

/* Purchase popup specific styles */
.social-proof-popup.purchase-popup .social-proof-content {
    align-items: flex-start;
}

.social-proof-popup.purchase-popup .social-proof-text {
    color: #1f2937;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInUpMobile {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDownMobile {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .social-proof-popup {
        padding: 14px 16px;
    }
    
    .social-proof-content {
        gap: 10px;
    }
    
    .social-proof-text {
        font-size: 13px;
    }
    
    .social-proof-time {
        font-size: 11px;
    }
    
    .social-proof-flag,
    .social-proof-success {
        width: 28px;
        height: 28px;
    }
    
    .social-proof-flag {
        height: 21px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .social-proof-popup {
        transition: opacity 0.2s ease;
    }
    
    .social-proof-popup.show {
        transform: none;
    }
    
    .social-proof-popup.hide {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .social-proof-popup {
        border: 2px solid #000;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
    
    .social-proof-close {
        border: 1px solid #666;
    }
}

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