/* ─────────────────────────────────────────────────────────────
   Tử Vi Đỗ Nhất — Thông báo hoạt động người dùng (social proof)
   Phong cách: huyền học cao cấp, nền đỏ sẫm + viền/chữ vàng kim.
───────────────────────────────────────────────────────────── */

.tuvi-sp-container {
    position: fixed;
    z-index: 99990; /* dưới modal chính của plugin (thường 999999) nhưng trên nội dung trang */
    bottom: 24px;
    pointer-events: none; /* container không chặn click; popup con tự bật lại pointer-events */
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tuvi-sp-container.tuvi-sp-left  { left: 20px; }
.tuvi-sp-container.tuvi-sp-right { right: 20px; }

.tuvi-sp-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 340px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3a0d0d 0%, #5c1010 55%, #3a0d0d 100%);
    border: 1px solid rgba(212, 175, 55, 0.55);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(212, 175, 55, 0.08) inset,
        0 0 24px rgba(212, 175, 55, 0.08);
    font-family: 'Be Vietnam Pro', -apple-system, sans-serif;
    color: #f5e6c8;

    /* Trạng thái ẩn ban đầu — JS toggle class .tuvi-sp-show để chạy animation */
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.tuvi-sp-toast.tuvi-sp-show {
    opacity: 1;
    transform: translateY(0);
}

.tuvi-sp-toast.tuvi-sp-hide {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

/* Icon tròn theo từng loại sự kiện — KHÔNG dùng emoji, dùng SVG:
   - .tuvi-sp-icon-gold   : sao VÀNG phát sáng — sự kiện MỞ KHÓA bản trả phí.
   - .tuvi-sp-icon-silver : sao BẠC, không phát sáng — sự kiện dùng bản miễn phí.
   - .tuvi-sp-icon-green  : tích XANH LÁ — các sự kiện còn lại (tạo lá số, đánh giá...). */
.tuvi-sp-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tuvi-sp-icon-gold {
    background: radial-gradient(circle at 30% 30%, #fff3c4, #f6d774 45%, #b8860b 100%);
    color: #7a4e00;
    box-shadow:
        0 0 0 2px rgba(212, 175, 55, 0.45),
        0 0 12px 3px rgba(246, 215, 116, 0.65);
    animation: tuvi-sp-gold-glow 1.8s ease-in-out infinite;
}

@keyframes tuvi-sp-gold-glow {
    0%, 100% {
        box-shadow:
            0 0 0 2px rgba(212, 175, 55, 0.45),
            0 0 10px 2px rgba(246, 215, 116, 0.55);
    }
    50% {
        box-shadow:
            0 0 0 2px rgba(212, 175, 55, 0.65),
            0 0 18px 6px rgba(246, 215, 116, 0.9);
    }
}

.tuvi-sp-icon-silver {
    background: radial-gradient(circle at 30% 30%, #f2f2f2, #c8ccd1 55%, #9aa0a6 100%);
    color: #4b4f56;
    box-shadow: 0 0 0 2px rgba(200, 204, 209, 0.4);
}

.tuvi-sp-icon-green {
    background: transparent;
    color: #22c55e; /* xanh lá — đồng bộ với chấm "đang hoạt động" ở .tuvi-sp-time */
}

@media (prefers-reduced-motion: reduce) {
    .tuvi-sp-icon-gold { animation: none; }
}

.tuvi-sp-body { min-width: 0; flex: 1 1 auto; }

.tuvi-sp-text {
    font-size: 13.5px;
    line-height: 1.4;
    color: #f5e6c8;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tuvi-sp-text b {
    color: #f6d774;
    font-weight: 700;
}

.tuvi-sp-time {
    margin-top: 3px;
    font-size: 11.5px;
    color: rgba(245, 230, 200, 0.65);
    display: flex;
    align-items: center;
    gap: 5px;
}

.tuvi-sp-time::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80; /* chấm xanh "đang hoạt động" */
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
    flex: 0 0 auto;
}

.tuvi-sp-close {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: rgba(245, 230, 200, 0.55);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}
.tuvi-sp-close:hover {
    background: rgba(212, 175, 55, 0.18);
    color: #f6d774;
}

/* Viền vàng mảnh chạy dọc bên trái — điểm nhấn "huyền học cao cấp" */
.tuvi-sp-toast::before {
    content: "";
    position: absolute;
    /* dùng cùng bo góc container, nên toast cần position:relative */
}
.tuvi-sp-toast { position: relative; overflow: hidden; }
.tuvi-sp-toast::after {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #f6d774, #b8860b);
}

@media (max-width: 480px) {
    .tuvi-sp-container.tuvi-sp-left,
    .tuvi-sp-container.tuvi-sp-right {
        left: 12px;
        right: 12px;
        bottom: 16px;
    }
    .tuvi-sp-toast {
        max-width: none;
        width: 100%;
        padding: 12px 14px;
    }
    .tuvi-sp-text { font-size: 13px; -webkit-line-clamp: 3; }
}

@media (prefers-reduced-motion: reduce) {
    .tuvi-sp-toast { transition: opacity 0.15s linear; transform: none !important; }
}
