/* Social Proof Notifications – Frontend Styles */

.spn-notification {
    position: fixed;
    z-index: 99999;
    max-width: 340px;
    width: calc(100vw - 32px);
    background: #1a1a2e;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity  0.35s ease;
    will-change: transform, opacity;
    cursor: default;
}

/* Position variants */
.spn-notification.spn-bottom-left  { bottom: 24px; left: 16px; }
.spn-notification.spn-bottom-right { bottom: 24px; right: 16px; }
.spn-notification.spn-top-left     { top: 24px;    left: 16px; }
.spn-notification.spn-top-right    { top: 24px;    right: 16px; }

/* Hidden / visible states */
.spn-notification.spn-hidden {
    opacity: 0;
    pointer-events: none;
}
.spn-notification.spn-bottom-left.spn-hidden,
.spn-notification.spn-bottom-right.spn-hidden {
    transform: translateY(20px);
}
.spn-notification.spn-top-left.spn-hidden,
.spn-notification.spn-top-right.spn-hidden {
    transform: translateY(-20px);
}
.spn-notification.spn-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Top row: label + time */
.spn-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spn-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #a8a8c0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.spn-label svg {
    flex-shrink: 0;
    color: #a8a8c0;
}

.spn-time {
    font-size: 11px;
    color: #6e6e88;
    white-space: nowrap;
}

/* Main content row */
.spn-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spn-text {
    flex: 1;
    min-width: 0;
}

.spn-message {
    font-size: 13.5px;
    line-height: 1.45;
    color: #e8e8f0;
    margin: 0;
}

.spn-message strong {
    color: #ffffff;
    font-weight: 700;
}

.spn-message a.spn-product-link {
    color: #6eb8ff;
    font-weight: 600;
    text-decoration: none;
}
.spn-message a.spn-product-link:hover {
    text-decoration: underline;
}

.spn-location {
    font-size: 12px;
    color: #6eb8ff;
    font-weight: 600;
}

.spn-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #2a2a44;
}

.spn-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spn-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a4a66;
}

/* Footer row: verified badge + close */
.spn-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spn-verified {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #5cb85c;
    font-weight: 600;
}

.spn-verified svg {
    flex-shrink: 0;
}

.spn-close {
    background: none;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
    color: #4a4a66;
    font-size: 16px;
    line-height: 1;
    transition: color 0.15s;
}
.spn-close:hover { color: #a8a8c0; }

/* Progress bar */
.spn-progress {
    height: 2px;
    background: #2a2a44;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

.spn-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6eb8ff, #5cb85c);
    border-radius: 2px;
    transition: width linear;
}

/* Mobile: ~50% smaller via scale */
@media (max-width: 480px) {
    .spn-notification {
        max-width: 340px;
        transform-origin: bottom left;
        transform: scale(0.65) translateY(0);
    }
    .spn-notification.spn-bottom-right {
        transform-origin: bottom right;
    }
    .spn-notification.spn-top-left {
        transform-origin: top left;
    }
    .spn-notification.spn-top-right {
        transform-origin: top right;
    }

    /* Re-apply hidden states with scale baked in */
    .spn-notification.spn-bottom-left.spn-hidden,
    .spn-notification.spn-bottom-right.spn-hidden {
        transform: scale(0.65) translateY(20px);
        opacity: 0;
    }
    .spn-notification.spn-top-left.spn-hidden,
    .spn-notification.spn-top-right.spn-hidden {
        transform: scale(0.65) translateY(-20px);
        opacity: 0;
    }
    .spn-notification.spn-visible {
        transform: scale(0.65) translateY(0);
        opacity: 1;
    }
}
