/**
 * Live Social Proof Notification CSS
 * DagangHub Plugin - Precision Match for Modern Card UI
 */

.adqp-social-proof-wrap {
    position: fixed !important;
    z-index: 999900 !important;
    display: flex;
    flex-direction: column;
    pointer-events: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Otomatis sembunyikan / nonaktifkan klik Social Proof saat Floating Chat / Live Chat aktif */
body:has(.adqp-floating-wrap:hover) .adqp-social-proof-wrap,
body:has(.adqp-wa-bubble-popup.is-open) .adqp-social-proof-wrap,
body:has(.adqp-wa-bubble-popup.is-active) .adqp-social-proof-wrap,
body:has(.adqp-livechat-modal.is-open) .adqp-social-proof-wrap {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body:has(.adqp-floating-wrap:hover) .adqp-social-proof-wrap .adqp-sp-card,
body:has(.adqp-wa-bubble-popup.is-open) .adqp-social-proof-wrap .adqp-sp-card,
body:has(.adqp-wa-bubble-popup.is-active) .adqp-social-proof-wrap .adqp-sp-card,
body:has(.adqp-livechat-modal.is-open) .adqp-social-proof-wrap .adqp-sp-card {
    pointer-events: none !important;
}

/* Positions */
.adqp-social-proof-wrap.pos-bottom-left {
    bottom: 24px;
    left: 24px;
}
.adqp-social-proof-wrap.pos-bottom-right {
    bottom: 24px;
    right: 24px;
}
.adqp-social-proof-wrap.pos-top-left {
    top: 24px;
    left: 24px;
}
.adqp-social-proof-wrap.pos-top-right {
    top: 24px;
    right: 24px;
}

/* Offset if WhatsApp Floating button is active */
.adqp-floating-wrap ~ .adqp-social-proof-wrap.pos-bottom-right,
body:has(.adqp-floating-wrap) .adqp-social-proof-wrap.pos-bottom-right {
    bottom: 95px !important;
}

/* Toast Card Container */
.adqp-sp-card {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    color: #1e293b;
    padding: 14px 18px;
    border-radius: 18px;
    box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.85);
    max-width: 410px;
    width: auto;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    cursor: default;
    opacity: 0;
}

/* Slide in & Fade Animations */
.adqp-sp-card.sp-slide-in {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: adqpSpSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.adqp-sp-card.sp-slide-out {
    animation: adqpSpSlideOut 0.35s ease forwards;
    pointer-events: none !important;
}

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

@keyframes adqpSpSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
}

/* Thumbnail Section */
.adqp-sp-thumb-wrap {
    display: flex;
    align-items: center;
    padding-right: 12px;
    border-right: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.adqp-sp-thumb {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #eff6ff;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(219, 234, 254, 0.8);
}

.adqp-sp-thumb.adqp-sp-thumb-partner {
    background: #ecfdf5;
    border-color: rgba(167, 243, 208, 0.8);
}

.adqp-sp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 13px;
}

.adqp-sp-thumb svg {
    display: block;
}

/* Content Area */
.adqp-sp-content {
    flex: 1;
    min-width: 0;
}

/* Header Badges */
.adqp-sp-header {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 6px;
    padding-right: 28px; /* Space for close button */
}

.adqp-sp-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1d4ed8;
    background: #dbeafe;
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1.2;
    display: inline-block;
}

.adqp-sp-card[data-type="partner"] .adqp-sp-title {
    color: #047857;
    background: #d1fae5;
}

.adqp-sp-badge {
    font-size: 11px;
    font-weight: 600;
    color: #15803d;
    background: #dcfce7;
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.adqp-sp-badge svg {
    display: inline-block;
    flex-shrink: 0;
}

/* Text Body */
.adqp-sp-text {
    font-size: 13px;
    line-height: 1.45;
    color: #1e293b;
    margin: 0;
    word-break: break-word;
}

.adqp-sp-text strong {
    color: #0f172a;
    font-weight: 700;
}

/* Footer & Time */
.adqp-sp-footer {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: 11.5px;
    color: #64748b;
}

.adqp-sp-footer svg {
    width: 13px;
    height: 13px;
    stroke: #64748b;
    flex-shrink: 0;
}

/* Close Button - Clean top-right aligned, immune to theme button CSS */
#adqp-social-proof-root .adqp-sp-card .adqp-sp-close,
.adqp-sp-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #64748b !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    line-height: 1 !important;
    border-radius: 50% !important;
    opacity: 0.85 !important;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease !important;
    z-index: 10 !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

#adqp-social-proof-root .adqp-sp-card .adqp-sp-close svg,
.adqp-sp-close svg {
    width: 14px !important;
    height: 14px !important;
    display: block !important;
    stroke: currentColor !important;
    pointer-events: none !important;
}

#adqp-social-proof-root .adqp-sp-card .adqp-sp-close:hover,
#adqp-social-proof-root .adqp-sp-card .adqp-sp-close:focus,
.adqp-sp-close:hover,
.adqp-sp-close:focus {
    opacity: 1 !important;
    color: #0f172a !important;
    background: #f1f5f9 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Dark Theme */
.adqp-social-proof-wrap.theme-dark .adqp-sp-card {
    background: #0f172a;
    color: #f8fafc;
    border-color: #1e293b;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.adqp-social-proof-wrap.theme-dark .adqp-sp-thumb-wrap {
    border-right-color: #1e293b;
}

.adqp-social-proof-wrap.theme-dark .adqp-sp-text {
    color: #cbd5e1;
}

.adqp-social-proof-wrap.theme-dark .adqp-sp-text strong {
    color: #ffffff;
}

.adqp-social-proof-wrap.theme-dark .adqp-sp-thumb {
    background: #1e293b;
    border-color: #334155;
}

#adqp-social-proof-root.theme-dark .adqp-sp-card .adqp-sp-close,
.adqp-social-proof-wrap.theme-dark .adqp-sp-close {
    color: #94a3b8 !important;
}

#adqp-social-proof-root.theme-dark .adqp-sp-card .adqp-sp-close:hover,
.adqp-social-proof-wrap.theme-dark .adqp-sp-close:hover {
    background: #1e293b !important;
    color: #f8fafc !important;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .adqp-social-proof-wrap.hide-mobile {
        display: none !important;
    }

    .adqp-social-proof-wrap.pos-bottom-left,
    .adqp-social-proof-wrap.pos-bottom-right {
        bottom: 16px;
        left: 16px;
        right: 16px;
    }

    .adqp-sp-card {
        max-width: 100%;
        width: 100%;
        padding: 12px 14px;
        border-radius: 14px;
    }

    .adqp-sp-thumb-wrap {
        padding-right: 10px;
    }

    .adqp-sp-thumb {
        width: 48px;
        height: 48px;
    }
}
