/* ============================================
   TaoVideo — Premium Toast Notification
   ============================================ */

/* ── Container ── */
.tv-toast-container {
    position: fixed; top: 24px; right: 24px; z-index: 99999;
    display: flex; flex-direction: column; gap: 12px;
    pointer-events: none;
}

/* ── Toast Card ── */
.tv-toast {
    display: flex; align-items: flex-start; gap: 14px;
    min-width: 320px; max-width: 420px;
    padding: 18px 20px; border-radius: 16px;
    background: rgba(15, 18, 35, 0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
    pointer-events: all; cursor: pointer;
    transform: translateX(120%); opacity: 0;
    animation: tvToastIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-family: var(--font, 'Plus Jakarta Sans', sans-serif);
}
.tv-toast.tv-toast-out {
    animation: tvToastOut 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* ── Icon Ring ── */
.tv-toast-icon {
    flex-shrink: 0; width: 44px; height: 44px;
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    font-size: 20px; position: relative;
}
.tv-toast-icon::before {
    content: ''; position: absolute; inset: -3px;
    border-radius: 50%; opacity: 0.4;
    animation: tvPulseRing 2s ease-in-out infinite;
}

/* Success */
.tv-toast.tv-success .tv-toast-icon {
    background: rgba(34, 197, 94, 0.15); color: #22c55e;
}
.tv-toast.tv-success .tv-toast-icon::before {
    border: 2px solid #22c55e;
}
.tv-toast.tv-success { border-color: rgba(34, 197, 94, 0.2); }

/* Error */
.tv-toast.tv-error .tv-toast-icon {
    background: rgba(239, 68, 68, 0.15); color: #ef4444;
}
.tv-toast.tv-error .tv-toast-icon::before {
    border: 2px solid #ef4444;
}
.tv-toast.tv-error { border-color: rgba(239, 68, 68, 0.2); }

/* Warning */
.tv-toast.tv-warning .tv-toast-icon {
    background: rgba(245, 158, 11, 0.15); color: #f59e0b;
}
.tv-toast.tv-warning .tv-toast-icon::before {
    border: 2px solid #f59e0b;
}
.tv-toast.tv-warning { border-color: rgba(245, 158, 11, 0.2); }

/* Info */
.tv-toast.tv-info .tv-toast-icon {
    background: rgba(99, 102, 241, 0.15); color: #818cf8;
}
.tv-toast.tv-info .tv-toast-icon::before {
    border: 2px solid #818cf8;
}
.tv-toast.tv-info { border-color: rgba(99, 102, 241, 0.2); }

/* ── Icon animation ── */
.tv-toast-icon i {
    animation: tvIconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

/* ── Body ── */
.tv-toast-body { flex: 1; min-width: 0; }
.tv-toast-title {
    font-size: 0.88rem; font-weight: 800; color: #fff;
    margin-bottom: 3px; line-height: 1.3;
}
.tv-toast-msg {
    font-size: 0.78rem; color: rgba(255,255,255,0.65);
    line-height: 1.5; word-break: break-word;
}

/* ── Close ── */
.tv-toast-close {
    flex-shrink: 0; width: 28px; height: 28px;
    border-radius: 8px; border: none;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4);
    font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.tv-toast-close:hover {
    background: rgba(255,255,255,0.12); color: #fff;
}

/* ── Progress bar ── */
.tv-toast-progress {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 3px; border-radius: 0 0 16px 16px; overflow: hidden;
}
.tv-toast-progress-bar {
    height: 100%; border-radius: 0 0 16px 16px;
    width: 100%;
    animation: tvProgressShrink var(--duration, 4s) linear forwards;
    animation-play-state: running;
}
.tv-success .tv-toast-progress-bar { background: linear-gradient(90deg, #22c55e, #4ade80); }
.tv-error .tv-toast-progress-bar { background: linear-gradient(90deg, #ef4444, #f87171); }
.tv-warning .tv-toast-progress-bar { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tv-info .tv-toast-progress-bar { background: linear-gradient(90deg, #6366f1, #818cf8); }

/* ── Keyframes ── */
@keyframes tvToastIn {
    0% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
@keyframes tvToastOut {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(120%); opacity: 0; }
}
@keyframes tvPulseRing {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.15); opacity: 0.1; }
}
@keyframes tvIconBounce {
    0% { transform: scale(0) rotate(-20deg); }
    60% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}
@keyframes tvProgressShrink {
    0% { width: 100%; }
    100% { width: 0%; }
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .tv-toast-container { top: 12px; right: 12px; left: 12px; }
    .tv-toast { min-width: auto; max-width: 100%; padding: 14px 16px; }
}
