/* Modern Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    pointer-events: auto;
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(450px);
    opacity: 0;
}

/* Toast Types */
.toast.success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.toast.error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.toast.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.toast.info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    animation: iconPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.success .toast-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast.error .toast-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast.warning .toast-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.toast.info .toast-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Toast Content */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin: 0;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* Close Button */
.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
    padding: 0;
    margin: -4px -4px 0 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #4b5563;
    transform: scale(1.1);
}

.toast-close:active {
    transform: scale(0.95);
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor);
    border-radius: 0 0 0 12px;
    transform-origin: left;
    animation: progress linear forwards;
}

.toast.success .toast-progress {
    color: #10b981;
}

.toast.error .toast-progress {
    color: #ef4444;
}

.toast.warning .toast-progress {
    color: #f59e0b;
}

.toast.info .toast-progress {
    color: #3b82f6;
}

/* Animations */
@keyframes iconPop {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100vw - 20px);
    }

    .toast {
        min-width: 100%;
        max-width: 100%;
        transform: translateY(-120px);
    }

    .toast.show {
        transform: translateY(0);
    }

    .toast.hide {
        transform: translateY(-120px);
    }
}

/* Stacking Effect */
.toast:nth-child(2) {
    transform: translateX(450px) scale(0.96);
    opacity: 0.8;
}

.toast:nth-child(3) {
    transform: translateX(450px) scale(0.92);
    opacity: 0.6;
}

.toast.show:nth-child(2) {
    transform: translateX(0) scale(0.96);
}

.toast.show:nth-child(3) {
    transform: translateX(0) scale(0.92);
}

/* Hover Effect */
.toast:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateX(0) translateY(-2px) !important;
}

.toast:hover .toast-progress {
    animation-play-state: paused;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1f2937;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .toast.success {
        background: linear-gradient(135deg, #1f2937 0%, #064e3b 100%);
    }

    .toast.error {
        background: linear-gradient(135deg, #1f2937 0%, #7f1d1d 100%);
    }

    .toast.warning {
        background: linear-gradient(135deg, #1f2937 0%, #78350f 100%);
    }

    .toast.info {
        background: linear-gradient(135deg, #1f2937 0%, #1e3a8a 100%);
    }

    .toast-title {
        color: #f9fafb;
    }

    .toast-message {
        color: #d1d5db;
    }

    .toast-close {
        color: #9ca3af;
    }

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