/**
 * Shared Toast Notification Styles
 * 
 * Reusable CSS for toast notifications across the entire application.
 * Include this file in your base template or specific pages that need toast notifications.
 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    pointer-events: none; /* Allow clicks to pass through container */
}

/* Individual Toast */
.toast {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    position: relative;
    pointer-events: auto; /* Re-enable pointer events for individual toasts */
    min-height: 48px;
    max-width: 100%;
    word-wrap: break-word;
}

/* Toast Types */
.toast-success {
    background-color: #10b981;
    color: white;
    border-left: 4px solid #059669;
}

.toast-error {
    background-color: #ef4444;
    color: white;
    border-left: 4px solid #dc2626;
}

.toast-warning {
    background-color: #f59e0b;
    color: white;
    border-left: 4px solid #d97706;
}

.toast-info {
    background-color: #3b82f6;
    color: white;
    border-left: 4px solid #2563eb;
}

/* Toast Content */
.toast-icon {
    margin-right: 12px;
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
    font-size: 14px;
}

.toast-close {
    margin-left: 12px;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.8;
    transition: opacity 0.2s;
    flex-shrink: 0;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
}

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

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        margin-bottom: 8px;
        padding: 10px 14px;
        min-height: 44px;
    }
    
    .toast-icon {
        font-size: 16px;
        margin-right: 10px;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    .toast-close {
        font-size: 14px;
        margin-left: 10px;
        min-width: 20px;
        min-height: 20px;
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 5px;
        right: 5px;
        left: 5px;
    }
    
    .toast {
        padding: 8px 12px;
        margin-bottom: 6px;
        min-height: 40px;
    }
    
    .toast-icon {
        font-size: 14px;
        margin-right: 8px;
    }
    
    .toast-message {
        font-size: 12px;
    }
    
    .toast-close {
        font-size: 12px;
        margin-left: 8px;
        min-width: 18px;
        min-height: 18px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .toast {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .toast {
        border: 2px solid currentColor;
    }
    
    .toast-success {
        background-color: #065f46;
        border-color: #10b981;
    }
    
    .toast-error {
        background-color: #991b1b;
        border-color: #ef4444;
    }
    
    .toast-warning {
        background-color: #92400e;
        border-color: #f59e0b;
    }
    
    .toast-info {
        background-color: #1e40af;
        border-color: #3b82f6;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
    }
    
    .toast.fade-out {
        animation: none;
        opacity: 0;
    }
    
    .toast-close {
        transition: none;
    }
}
