/* Universal Notification System - Premium Version */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    zoom: 0.8;
}

.toast {
    position: relative;
    pointer-events: auto;
    min-width: 300px;
    max-width: 420px;
    padding: 16px 20px;
    padding-right: 40px;
    /* Space for close button */
    border-radius: 12px;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    overflow: hidden;
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
    user-select: none;
    touch-action: pan-y pinch-zoom;
}

.toast:hover {
    background: rgba(30, 30, 30, 0.95);
    transform: translateY(-2px);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-msg {
    flex: 1;
    line-height: 1.4;
}

/* Close/Cross Button (Desktop) */
.toast-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.toast-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Gradient Timer/Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff6b35, #ff9f35, #ff6b35);
    background-size: 200% 100%;
    transform-origin: left;
    transition: transform 0.1s linear;
    animation: toast-shimmer 2s linear infinite;
}

/* Pause animation on hover */
.toast:hover .toast-progress-bar {
    animation-play-state: paused;
}

@keyframes toast-shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@keyframes toast-in {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateX(20px) scale(0.8);
        opacity: 0;
    }
}

.toast.removing {
    animation: toast-out 0.3s ease-out forwards;
}

/* Swiping State (Mobile) */
.toast.swiping {
    transition: none;
}

/* Variants */
.toast-success .toast-progress-bar {
    background: linear-gradient(90deg, #10b981, #34d399, #10b981);
}

.toast-error .toast-progress-bar {
    background: linear-gradient(90deg, #ef4444, #f87171, #ef4444);
}

.toast-warning .toast-progress-bar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
}

.toast-info .toast-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
}

/* Alert Modal Overlay */
#alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#alert-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.alert-modal {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

#alert-overlay.visible .alert-modal {
    transform: scale(1) translateY(0);
}

.alert-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
    letter-spacing: -0.5px;
}

.alert-message {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 32px;
}

.alert-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.alert-btn {
    padding: 12px 32px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.alert-btn-primary {
    background: #ff6b35;
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.alert-btn-primary:hover {
    background: #ff8555;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

@media (max-width: 768px) {
    #toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }
}