/* ==========================================================================
   HMK Data VTU - Futuristic Animated Toast Notification System
   ========================================================================== */

.toast-container {
    position: fixed !important;
    top: 1.5rem !important;
    right: 1.5rem !important;
    z-index: 99999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    pointer-events: none !important;
    max-width: calc(100vw - 2rem) !important;
    width: 390px !important;
}

@media (max-width: 640px) {
    .toast-container {
        top: 1rem !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        align-items: center !important;
    }
}

/* Individual Toast Card */
.toast-item {
    position: relative !important;
    pointer-events: auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: 18px !important;
    padding: 1rem 1rem 1.15rem 1rem !important;
    box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.9) inset,
                0 8px 18px -6px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    user-select: none !important;
    animation: toastSlideIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease !important;
}

.dark .toast-item {
    background: rgba(15, 23, 42, 0.92) !important;
    box-shadow: 0 22px 50px -12px rgba(0, 0, 0, 0.65),
                0 0 0 1px rgba(255, 255, 255, 0.08) inset,
                0 10px 20px -6px rgba(0, 0, 0, 0.4) !important;
}

.toast-item:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 1) inset !important;
}

.dark .toast-item:hover {
    box-shadow: 0 26px 55px -10px rgba(0, 0, 0, 0.8),
                0 0 0 1px rgba(255, 255, 255, 0.14) inset !important;
}

/* Toast Leaving Animation */
.toast-item.toast-leaving {
    animation: toastSlideOut 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    pointer-events: none !important;
}

/* Content Layout */
.toast-body {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.85rem !important;
}

/* Icon Wrap */
.toast-icon-wrap {
    width: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.15rem !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

/* Text Container */
.toast-content {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    padding-top: 0.1rem !important;
}

.toast-title {
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    margin-bottom: 0.2rem !important;
    line-height: 1.2 !important;
}

.toast-message {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    line-height: 1.45 !important;
    word-break: break-word !important;
}

.dark .toast-message {
    color: #cbd5e1 !important;
}

/* Close Button */
.toast-close-btn {
    position: absolute !important;
    top: 0.65rem !important;
    right: 0.65rem !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    transition: all 0.18s ease !important;
}

.toast-close-btn:hover {
    color: #1e293b !important;
    background: rgba(0, 0, 0, 0.06) !important;
    transform: scale(1.1) !important;
}

.dark .toast-close-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Bottom Progress Countdown Bar */
.toast-progress-track {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3.5px !important;
    background: rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
}

.dark .toast-progress-track {
    background: rgba(255, 255, 255, 0.05) !important;
}

.toast-progress-bar {
    height: 100% !important;
    width: 100% !important;
    transform-origin: left !important;
    animation: toastCountdown linear forwards !important;
}

/* Pause countdown when hovering over toast */
.toast-item:hover .toast-progress-bar {
    animation-play-state: paused !important;
}

/* Type Variations */

/* Success */
.toast-item.toast-success {
    border-left: 4px solid #10b981 !important;
}
.toast-item.toast-success .toast-icon-wrap {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, rgba(16, 185, 129, 0.08) 100%) !important;
    color: #10b981 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.28) !important;
}
.toast-item.toast-success .toast-title {
    color: #059669 !important;
}
.dark .toast-item.toast-success .toast-title {
    color: #34d399 !important;
}
.toast-item.toast-success .toast-progress-bar {
    background: linear-gradient(90deg, #10b981, #06b6d4) !important;
}

/* Error / Danger */
.toast-item.toast-error {
    border-left: 4px solid #f43f5e !important;
}
.toast-item.toast-error .toast-icon-wrap {
    background: radial-gradient(circle, rgba(244, 63, 94, 0.22) 0%, rgba(244, 63, 94, 0.08) 100%) !important;
    color: #f43f5e !important;
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.28) !important;
}
.toast-item.toast-error .toast-title {
    color: #e11d48 !important;
}
.dark .toast-item.toast-error .toast-title {
    color: #fb7185 !important;
}
.toast-item.toast-error .toast-progress-bar {
    background: linear-gradient(90deg, #f43f5e, #fb7185) !important;
}

/* Warning */
.toast-item.toast-warning {
    border-left: 4px solid #f59e0b !important;
}
.toast-item.toast-warning .toast-icon-wrap {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, rgba(245, 158, 11, 0.08) 100%) !important;
    color: #f59e0b !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.28) !important;
}
.toast-item.toast-warning .toast-title {
    color: #d97706 !important;
}
.dark .toast-item.toast-warning .toast-title {
    color: #fbbf24 !important;
}
.toast-item.toast-warning .toast-progress-bar {
    background: linear-gradient(90deg, #f59e0b, #eab308) !important;
}

/* Info */
.toast-item.toast-info {
    border-left: 4px solid #3b82f6 !important;
}
.toast-item.toast-info .toast-icon-wrap {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0.08) 100%) !important;
    color: #3b82f6 !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.28) !important;
}
.toast-item.toast-info .toast-title {
    color: #2563eb !important;
}
.dark .toast-item.toast-info .toast-title {
    color: #60a5fa !important;
}
.toast-item.toast-info .toast-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #6366f1) !important;
}

/* Animations Keyframes */
@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(110%) scale(0.92);
    }
    70% {
        transform: translateX(-4px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
        max-height: 140px;
        margin-bottom: 0.75rem;
    }
    100% {
        opacity: 0;
        transform: translateX(115%) scale(0.92);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

@keyframes toastCountdown {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}
