/**
 * Modern Toast Notification Styles
 * Replaces the old database-driven notification system
 */

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
    pointer-events: auto;
    overflow: hidden;
    position: relative;
    min-width: 300px;
    max-width: 400px;
}

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

.toast.removing {
    opacity: 0;
    transform: translateY(-20px);
}

.toast-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.toast-icon {
    flex-shrink: 0;
    font-size: 20px;
    margin-top: 2px;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1f2937;
}

.toast-message {
    font-size: 13px;
    line-height: 1.4;
    color: #4b5563;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background-color: #f3f4f6;
    color: #6b7280;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: currentColor;
    opacity: 0.3;
    animation: toast-progress 5s linear forwards;
}

/* Toast type variations */
.toast-success {
    border-left: 4px solid #10b981;
}

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

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

.toast-error {
    border-left: 4px solid #ef4444;
}

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

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

.toast-warning {
    border-left: 4px solid #f59e0b;
}

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

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

.toast-info {
    border-left: 4px solid #3b82f6;
}

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

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

/* Progress bar animation */
@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Responsive design */
@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 20px);
        max-width: 600px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
    
    .toast-content {
        padding: 14px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .toast-title {
        color: #f9fafb;
    }
    
    .toast-message {
        color: #d1d5db;
    }
    
    .toast-close {
        color: #9ca3af;
    }
    
    .toast-close:hover {
        background-color: #374151;
        color: #d1d5db;
    }
}

/* Animation for multiple toasts */
.toast:nth-child(1) { animation-delay: 0ms; }
.toast:nth-child(2) { animation-delay: 100ms; }
.toast:nth-child(3) { animation-delay: 200ms; }
.toast:nth-child(4) { animation-delay: 300ms; }
.toast:nth-child(5) { animation-delay: 400ms; }

/* Hover effects */
.toast:hover .toast-progress {
    animation-play-state: paused;
}

.toast:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
