/**
 * Social Proof Notifications Frontend CSS
 *
 * Provides responsive floating layout containers, sliding transitions,
 * glassmorphic effects, circular avatars, and close buttons.
 */

/* Container wrapper */
#dsp-container {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 380px;
    max-width: calc(100vw - 32px);
    padding: 16px;
    box-sizing: border-box;
}

/* Positions */
#dsp-container.dsp-container--bottom-left {
    bottom: 0;
    left: 0;
}
#dsp-container.dsp-container--bottom-right {
    bottom: 0;
    right: 0;
}
#dsp-container.dsp-container--top-left {
    top: 0;
    left: 0;
}
#dsp-container.dsp-container--top-right {
    top: 0;
    right: 0;
}

/* Desktop-only media query */
@media (max-width: 768px) {
    #dsp-container.dsp-container--desktop-only {
        display: none !important;
    }
}

/* Notification Card Component */
.dsp-notification {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.4;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s ease;
}

/* Rounded card profile */
.dsp-notification.dsp-has-avatar {
    padding-left: 16px;
}

/* Avatar Circle */
.dsp-avatar-wrapper {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f5f9;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dsp-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dsp-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
}

/* Details Section */
.dsp-content {
    flex: 1;
    min-width: 0;
}
.dsp-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dsp-message {
    font-size: 13px;
    color: #475569;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dsp-time {
    font-size: 11px;
    color: #94a3b8;
    margin: 0;
    font-weight: 500;
}

/* Close Button Icon */
.dsp-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.2s, color 0.2s;
}
.dsp-close:hover {
    background-color: #f1f5f9;
    color: #475569;
}
.dsp-close svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* Keyframe animations */
@keyframes dsp-slide-in-left {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
@keyframes dsp-slide-in-right {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
@keyframes dsp-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes dsp-bounce-in {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    70% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animation triggers */
.dsp-animate-slide-in-left {
    animation: dsp-slide-in-left 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.dsp-animate-slide-in-right {
    animation: dsp-slide-in-right 0.5 cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.dsp-animate-fade-in {
    animation: dsp-fade-in 0.4s ease-out forwards;
}
.dsp-animate-bounce-in {
    animation: dsp-bounce-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Exit transitions */
.dsp-exit {
    opacity: 0 !important;
    transform: scale(0.9) !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}
