/* Enhanced Toast Notification Styles */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 320px;
    max-width: 480px;
    font-family: 'Jost', sans-serif;
}

.toast-notification .toast {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    border: none;
    border-left: 5px solid;
    opacity: 1 !important;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.toast-notification .toast:hover {
    transform: translateX(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.toast-notification .toast-header {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding: 14px 18px;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
}

.toast-notification .toast-header strong {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-notification .toast-header i {
    font-size: 20px;
}

.toast-notification .toast-body {
    padding: 16px 18px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0 0 12px 12px;
    font-weight: 500;
}

/* Success toast - Enhanced */
.toast-notification .toast-success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f0fff4 100%);
}

.toast-notification .toast-success .toast-header {
    color: #28a745;
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(240,255,244,0.98) 100%);
}

.toast-notification .toast-success .toast-header i {
    color: #28a745;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Error toast - Enhanced */
.toast-notification .toast-error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
}

.toast-notification .toast-error .toast-header {
    color: #dc3545;
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(255,245,245,0.98) 100%);
}

.toast-notification .toast-error .toast-header i {
    color: #dc3545;
    animation: shake 0.5s ease-in-out;
}

/* Warning toast - Enhanced */
.toast-notification .toast-warning {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, #ffffff 0%, #fff9f0 100%);
}

.toast-notification .toast-warning .toast-header {
    color: #ff9800;
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(255,249,240,0.98) 100%);
}

.toast-notification .toast-warning .toast-header i {
    color: #ff9800;
}

/* Info toast - Enhanced */
.toast-notification .toast-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
}

.toast-notification .toast-info .toast-header {
    color: #17a2b8;
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(240,249,255,0.98) 100%);
}

.toast-notification .toast-info .toast-header i {
    color: #17a2b8;
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
    }
    100% {
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.6);
    }
}

.toast-notification .toast {
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* Close button styling - Enhanced */
.toast-notification .btn-close {
    font-size: 12px;
    opacity: 0.6;
    transition: all 0.3s ease;
    padding: 0.5rem;
    margin: -0.25rem -0.25rem -0.25rem auto;
    background: transparent;
    border-radius: 50%;
}

.toast-notification .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
    background: rgba(0, 0, 0, 0.05);
}

/* Progress bar for auto-dismiss */
.toast-notification .toast {
    position: relative;
    overflow: hidden;
}

.toast-notification .toast::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    animation: progressBar 5s linear forwards;
}

.toast-notification .toast-success::before {
    background: linear-gradient(90deg, #28a745, #34ce57);
}

.toast-notification .toast-error::before {
    background: linear-gradient(90deg, #dc3545, #ff6b6b);
}

.toast-notification .toast-warning::before {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.toast-notification .toast-info::before {
    background: linear-gradient(90deg, #17a2b8, #5bc0de);
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Multiple toasts stacking */
.toast-notification .toast {
    margin-bottom: 12px;
}

.toast-notification .toast:last-child {
    margin-bottom: 0;
}

/* Add entrance animation for multiple toasts */
.toast-notification .toast:nth-child(1) {
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification .toast:nth-child(2) {
    animation: slideInRight 0.45s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification .toast:nth-child(3) {
    animation: slideInRight 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Icon animations */
.toast-notification .toast-header i {
    transition: transform 0.3s ease;
}

.toast-notification .toast:hover .toast-header i {
    transform: scale(1.1);
}

/* Success toast special glow effect */
.toast-notification .toast-success:hover {
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
}

/* Error toast special glow effect */
.toast-notification .toast-error:hover {
    box-shadow: 0 10px 30px rgba(220, 53, 69, 0.3);
}

/* Custom scrollbar for long messages */
.toast-notification .toast-body {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.toast-notification .toast-body::-webkit-scrollbar {
    width: 4px;
}

.toast-notification .toast-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.toast-notification .toast-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.toast-notification .toast-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .toast-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .toast-notification .toast {
        width: 100%;
    }
    
    .toast-notification .toast-header {
        padding: 12px 15px;
    }
    
    .toast-notification .toast-header strong {
        font-size: 14px;
    }
    
    .toast-notification .toast-body {
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .toast-notification .toast {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }
    
    .toast-notification .toast-header {
        background: linear-gradient(135deg, rgba(45,45,45,0.98) 0%, rgba(26,26,26,0.98) 100%);
        border-bottom-color: rgba(255,255,255,0.1);
    }
    
    .toast-notification .toast-body {
        color: #e0e0e0;
        background: rgba(26, 26, 26, 0.9);
    }
    
    .toast-notification .btn-close {
        filter: invert(1);
    }
    
    .toast-notification .btn-close:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Focus styles for accessibility */
.toast-notification .btn-close:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.5);
    opacity: 1;
}

/* Print styles */
@media print {
    .toast-notification {
        display: none;
    }
}