/**
 * CrestanaDS Sales FOMO - Public Stylesheet
 * Custom CSS for frontend popup notifications. Uses CSS custom variables for dynamic customization.
 */

:root {
    --crestanads-fomo-bg: #ffffff;
    --crestanads-fomo-text: #1f2937;
    --crestanads-fomo-link: #10b981;
    --crestanads-fomo-radius: 12px;
}

.crestanads-fomo-popup-wrapper {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    pointer-events: none; /* Let clicks pass through unless on the popup */
    width: auto;
    max-width: 360px;
    box-sizing: border-box;
}

/* Positions */
.crestanads-fomo-pos-bottom-left {
    bottom: 24px;
    left: 24px;
}

.crestanads-fomo-pos-bottom-right {
    bottom: 24px;
    right: 24px;
}

.crestanads-fomo-pos-top-left {
    top: 24px;
    left: 24px;
}

.crestanads-fomo-pos-top-right {
    top: 24px;
    right: 24px;
}

/* Notification card */
.crestanads-fomo-popup {
    pointer-events: auto; /* Re-enable pointer events for interactions */
    background-color: var(--crestanads-fomo-bg);
    color: var(--crestanads-fomo-text);
    border-radius: var(--crestanads-fomo-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(229, 231, 235, 0.7);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px) scale(0.95);
}

/* Glassmorphism subtle overlay if white background */
.crestanads-fomo-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--crestanads-fomo-link) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Active / Visible state */
.crestanads-fomo-popup.crestanads-fomo-active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Outgoing state */
.crestanads-fomo-popup.crestanads-fomo-fade-out {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

/* Close Button */
.crestanads-fomo-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crestanads-fomo-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--crestanads-fomo-text);
}

/* Content Layout */
.crestanads-fomo-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crestanads-fomo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crestanads-fomo-image svg {
    width: 24px;
    height: 24px;
    color: var(--crestanads-fomo-link);
}

.crestanads-fomo-details {
    flex-grow: 1;
    padding-right: 12px;
}

.crestanads-fomo-buyer {
    margin: 0 0 2px 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--crestanads-fomo-text);
}

.crestanads-fomo-buyer strong {
    font-weight: 600;
}

.crestanads-fomo-product {
    margin: 0 0 4px 0;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
}

.crestanads-fomo-product a {
    color: var(--crestanads-fomo-link);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.crestanads-fomo-product a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

.crestanads-fomo-time-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
}

.crestanads-fomo-verified-badge {
    display: inline-flex;
    align-items: center;
    color: #10b981;
    font-weight: 500;
}

.crestanads-fomo-verified-badge svg {
    width: 12px;
    height: 12px;
    margin-right: 2px;
    fill: currentColor;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .crestanads-fomo-popup-wrapper {
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        top: auto !important; /* Force to bottom on mobile */
        max-width: none;
        width: calc(100% - 24px);
    }
    
    .crestanads-fomo-popup {
        padding: 12px;
        gap: 10px;
    }
    
    .crestanads-fomo-image {
        width: 40px;
        height: 40px;
    }
}
