/* Toast Container */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

/* Toast Item */
.toast {
    background: var(--bg-color, #ffffff);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    position: relative;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* Toast Types */
.toast.success {
    border-left-color: #10b981;
    background: #ffffff;
}

.toast.error {
    border-left-color: #ef4444;
    background: #ffffff;
}

.toast.warning {
    border-left-color: #f59e0b;
    background: #ffffff;
}

.toast.info {
    border-left-color: #3b82f6;
    background: #ffffff;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-top: 2px;
}

.toast.success .toast-icon {
    background: #d1fae5;
    color: #10b981;
}

.toast.error .toast-icon {
    background: #fee2e2;
    color: #ef4444;
}

.toast.warning .toast-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.toast.info .toast-icon {
    background: #dbeafe;
    color: #3b82f6;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-top: -4px;
    margin-right: -4px;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.toast-close svg {
    width: 18px;
    height: 18px;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    width: 100%;
    animation: toastProgress linear;
    transform-origin: left;
}

.toast.success .toast-progress-bar {
    background: #10b981;
}

.toast.error .toast-progress-bar {
    background: #ef4444;
}

.toast.warning .toast-progress-bar {
    background: #f59e0b;
}

.toast.info .toast-progress-bar {
    background: #3b82f6;
}

/* Animations */
@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: 100%;
    }

    .toast {
        min-width: 100%;
        max-width: 100%;
    }

    @keyframes toastSlideIn {
        from {
            transform: translateY(-100px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes toastSlideOut {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100px);
            opacity: 0;
        }
    }
}

