/* ========================================
   Toast Notification System CSS
   ======================================== */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

/* Individual Toast */
.toast {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 15px;
    overflow: hidden;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    max-width: 100%;
    min-width: 300px;
}

/* Show Animation */
.toast.show {
    transform: translateX(0);
}

/* Toast Header */
.toast-header {
    background: transparent;
    border: none;
    padding: 15px 20px 10px;
    font-weight: 600;
    font-size: 16px;
    color: #333 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Toast Body */
.toast-body {
    padding: 0 20px 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #333 !important;
}

/* Toast Types */
.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success .toast-header {
    color: #155724 !important;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error .toast-header {
    color: #721c24 !important;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-warning .toast-header {
    color: #856404 !important;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-info .toast-header {
    color: #0c5460 !important;
}

/* Close Button */
.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d !important;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.toast-close:hover {
    color: #000 !important;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Toast Icon */
.toast-icon {
    margin-right: 10px;
    font-size: 18px;
    display: inline-block;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.toast-header i {
    display: inline-block;
    vertical-align: middle;
}

/* Toast Title */
.toast-title {
    flex: 1;
    margin-right: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* Animation Keyframes */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Additional Utility Classes */
.toast-fade-in {
    animation: toastSlideIn 0.3s ease-out;
}

.toast-fade-out {
    animation: toastSlideOut 0.3s ease-in;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .toast-header {
        color: #e2e8f0 !important;
    }
    
    .toast-body {
        color: #e2e8f0 !important;
    }
    
    .toast-close {
        color: #a0aec0 !important;
    }
    
    .toast-close:hover {
        color: #e2e8f0 !important;
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* Bootstrap Integration */
.toast-container .toast {
    margin-bottom: 0.75rem;
}

/* Accessibility */
.toast[role="alert"] {
    aria-live: "polite";
    aria-atomic: "true";
}

/* Custom Scrollbar for Multiple Toasts */
.toast-container::-webkit-scrollbar {
    width: 4px;
}

.toast-container::-webkit-scrollbar-track {
    background: transparent;
}

.toast-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.toast-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
