/* Sistema Toast per Feedback */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999991;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    overflow: hidden;
    position: relative;
    min-width: 300px;
}

.dark .toast {
    background: var(--color-dark-surface);
    border-color: var(--color-dark-border);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    gap: 8px;
}

.dark .toast-header {
    border-bottom-color: var(--color-dark-border);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    flex-grow: 1;
    margin: 0;
    color: #222;
}

.toast.success .toast-title,
.toast.error .toast-title,
.toast.warning .toast-title,
.toast.info .toast-title {
    color: #222 !important;
}

.toast-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--color-text-primary);
}

.dark .toast-close {
    color: var(--color-dark-text-secondary);
}

.dark .toast-close:hover {
    color: var(--color-dark-text-primary);
}

.toast-body {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
    color: #222;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    transition: width linear;
    opacity: 0.7;
}

/* Varianti Toast con colori più evidenti */
.toast.success {
    border-left: 6px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
}

.dark .toast.success {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-left-color: #34d399;
}

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

.toast.success .toast-title {
    color: #047857;
    font-weight: 700;
}

.dark .toast.success .toast-title {
    color: #34d399;
}

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

.toast.error {
    border-left: 6px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.15);
}

.dark .toast.error {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border-left-color: #f87171;
}

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

.toast.error .toast-title {
    color: #dc2626;
    font-weight: 700;
}

.dark .toast.error .toast-title {
    color: #f87171;
}

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

.toast.warning {
    border-left: 6px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.15);
}

.dark .toast.warning {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    border-left-color: #fbbf24;
}

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

.toast.warning .toast-title {
    color: #d97706;
    font-weight: 700;
}

.dark .toast.warning .toast-title {
    color: #fbbf24;
}

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

.toast.info {
    border-left: 6px solid #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.dark .toast.info {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    border-left-color: #60a5fa;
}

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

.toast.info .toast-title {
    color: #1d4ed8;
    font-weight: 700;
}

.dark .toast.info .toast-title {
    color: #60a5fa;
}

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

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
    }
}
