/* Social Proof Widget Styles */

.social-proof-widget {
    position: fixed;
    z-index: 45;
    max-width: 360px;
    pointer-events: none;
    padding: 16px;
}

.social-proof-widget.position-bottom-left {
    bottom: 0;
    left: 0;
}

.social-proof-widget.position-bottom-right {
    bottom: 0;
    right: 0;
}

/* Frosted by default: the card is drawn from the page's own card colour at
   86% with the page blurred behind it, so the text stays readable whatever
   scrolls under it (the court-availability grid on the home page did).
   Every token has a fallback — the modern home page defines --surface/--ink,
   theme.css pages define --dark-card/--text-primary, and a page with neither
   still gets a white card. A tenant's own colour (Settings → Social proof)
   arrives as --sp-bg with its opacity already floored at 75%, and is blurred
   the same way; the widget then sets --sp-ink/--sp-ink-2/--sp-line to suit
   that colour, because a chosen colour does not change with the theme.
   The small meta line (time, Verified by) uses the muted ink, not the dim
   one: dim on the dark surface was about 3:1 at 10px. */
.social-proof-card {
    --sp-surface: var(--dark-card, var(--surface, #ffffff));
    --sp-ink: var(--text-primary, var(--ink, #16201b));
    --sp-ink-2: var(--text-muted, var(--muted, #51635a));
    --sp-ink-3: var(--sp-ink-2);
    --sp-line: var(--card-border, var(--line, rgba(20, 30, 25, 0.12)));
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--sp-bg, var(--sp-surface));
    background: var(--sp-bg, color-mix(in srgb, var(--sp-surface) 86%, transparent));
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--sp-line);
    color: var(--sp-ink);
    padding: 14px 16px;
    border-radius: var(--sp-radius, 16px);
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.35s ease;
}

.social-proof-card.visible {
    transform: translateY(0);
    opacity: 1;
}

.social-proof-card.exiting {
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.35s ease-in,
                opacity 0.3s ease-in;
}

/* Card style variants */
.social-proof-card.card-shadow {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10),
                0 1px 4px rgba(0, 0, 0, 0.06);
}

.social-proof-card.card-bordered {
    border-color: var(--sp-line);
}

.social-proof-card.card-both {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10),
                0 1px 4px rgba(0, 0, 0, 0.06);
    border-color: var(--sp-line);
}

/* Avatar */
.social-proof-avatar {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
    background: var(--sp-accent, var(--court-green, #22c55e));
}

/* Text content */
.social-proof-text {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}

.social-proof-name {
    font-weight: 700;
    color: var(--sp-ink);
    font-size: 0.875rem;
}

.social-proof-action {
    color: var(--sp-ink-2);
    font-size: 0.875rem;
}

.social-proof-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.social-proof-time {
    font-size: 0.75rem;
    color: var(--sp-ink-3);
}

.social-proof-verified {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    color: var(--sp-ink-3);
}

.social-proof-verified-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.social-proof-verified-link {
    color: var(--sp-ink-3);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.social-proof-verified-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* Close button — positioned outside the card, top-right corner */
.social-proof-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sp-bg, var(--sp-surface));
    border: 1px solid var(--sp-line);
    color: var(--sp-ink-3);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.social-proof-close:hover {
    color: var(--sp-ink);
    border-color: var(--sp-ink-3);
}

/* Review-specific styles */
.social-proof-review-text {
    font-style: italic;
    font-size: 0.8rem;
    color: var(--sp-ink-2);
    margin-top: 2px;
    line-height: 1.3;
}

.social-proof-stars {
    display: inline-flex;
    gap: 1px;
    font-size: 0.75rem;
    color: #f59e0b;
}

.social-proof-source {
    font-size: 0.75rem;
    color: var(--sp-ink-3);
}

.social-proof-source-link {
    color: var(--sp-ink-3);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.social-proof-source-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .social-proof-card,
    .social-proof-card.visible,
    .social-proof-card.exiting {
        transition: none;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .social-proof-widget {
        max-width: 100%;
        left: 0;
        right: 0;
        padding: 10px;
    }

    .social-proof-card {
        padding: 12px 14px;
    }

    .social-proof-avatar {
        width: 2.4rem;
        height: 2.4rem;
        font-size: 1rem;
    }
}
