/* Custom Toast Alert Styles for Better Visibility */

/* Toast Container Positioning */
#toast-container {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 999999 !important;
    pointer-events: none;
}

/* Individual Toast Styling */
#toast-container > div {
    position: relative !important;
    pointer-events: auto !important;
    overflow: hidden !important;
    margin: 0 0 15px !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    background-position: 15px center !important;
    background-repeat: no-repeat !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
    opacity: 1 !important;
    max-width: 400px !important;
    min-width: 300px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    border: none !important;
    background-color: #28a745 !important; /* Default success background */
}

/* Success Toast */
.toast-success {
    background: #28a745 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") !important;
    background-size: 20px 20px !important;
    background-position: 15px center !important;
    background-repeat: no-repeat !important;
    padding-left: 50px !important;
    color: #ffffff !important;
}

/* Error Toast */
.toast-error {
    background: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E") !important;
    background-size: 20px 20px !important;
    background-position: 15px center !important;
    background-repeat: no-repeat !important;
    padding-left: 50px !important;
    color: #ffffff !important;
}

/* Info Toast */
.toast-info {
    background: #17a2b8 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E") !important;
    background-size: 20px 20px !important;
    background-position: 15px center !important;
    background-repeat: no-repeat !important;
    padding-left: 50px !important;
    color: #ffffff !important;
}

/* Warning Toast */
.toast-warning {
    background: #5dade2 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E") !important;
    background-size: 20px 20px !important;
    background-position: 15px center !important;
    background-repeat: no-repeat !important;
    padding-left: 50px !important;
    color: #000000 !important;
}

/* Toast Title */
.toast-title {
    font-weight: 600 !important;
    font-size: 16px !important;
    color: #ffffff !important;
    margin-bottom: 5px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* Toast Message */
.toast-message {
    color: #ffffff !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    word-wrap: break-word !important;
    -ms-word-wrap: break-word !important;
}

/* Close Button */
.toast-close-button {
    position: absolute !important;
    right: 10px !important;
    top: 10px !important;
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: bold !important;
    opacity: 0.8 !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

.toast-close-button:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
}

/* Progress Bar */
.toast-progress {
    position: absolute !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 3px !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 0 0 8px 8px !important;
}

/* Hover Effects */
#toast-container > div:hover {
    transform: translateX(-5px) !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
}

/* Animation for new toasts */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#toast-container > div {
    animation: slideInRight 0.3s ease-out !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    #toast-container {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
    }
    
    #toast-container > div {
        max-width: none !important;
        min-width: auto !important;
        margin: 0 0 10px !important;
        padding: 12px 15px !important;
        padding-left: 45px !important;
    }
    
    .toast-title {
        font-size: 15px !important;
    }
    
    .toast-message {
        font-size: 13px !important;
    }
}

/* Override any conflicting styles */
.toast-container > div {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Force background colors for all toast types */
#toast-container .toast-error,
#toast-container .toast-error * {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

#toast-container .toast-success,
#toast-container .toast-success * {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

#toast-container .toast-info,
#toast-container .toast-info * {
    background-color: #17a2b8 !important;
    color: #ffffff !important;
}

#toast-container .toast-warning,
#toast-container .toast-warning * {
    background-color: #5dade2 !important;
    color: #000000 !important;
}

/* Ensure text is always visible */
.toast-message a,
.toast-message label {
    color: #ffffff !important;
    text-decoration: underline !important;
}

.toast-message a:hover {
    color: #f8f9fa !important;
    text-decoration: none !important;
}

/* Force text color for warning toasts */
.toast-warning .toast-message a,
.toast-warning .toast-message label,
.toast-warning .toast-title {
    color: #000000 !important;
}
