/**
 * Modern Notification System
 * 
 * A sophisticated toast notification system with animations and different types
 */

/* Toast Container */
.toast-container {
    position: fixed !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
    max-width: 100% !important;
    width: 24rem !important;
    pointer-events: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* Position Variants */
.toast-container.top-right {
    top: 0 !important;
    right: 0 !important;
}

.toast-container.top-left {
    top: 0;
    left: 0;
}

.toast-container.top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.toast-container.bottom-right {
    bottom: 0;
    right: 0;
}

.toast-container.bottom-left {
    bottom: 0;
    left: 0;
}

.toast-container.bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Toast Notification */
.toast {
    position: relative !important;
    display: flex !important;
    align-items: flex-start !important;
    width: 100% !important;
    min-width: 300px !important;
    max-width: 24rem !important;
    padding: 1rem !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
    color: #f9fafb !important;
    background-color: #1f2937 !important;
    border-left: 4px solid transparent !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    transform-origin: top center !important;
    animation: toast-in 0.3s cubic-bezier(0.21, 1.02, 0.73, 1) forwards !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.toast.toast-exiting {
    animation: toast-out 0.3s cubic-bezier(0.06, 0.71, 0.55, 1) forwards !important;
}

/* Toast Types */
.toast.success {
    border-left-color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
}

.toast.error {
    border-left-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.toast.warning {
    border-left-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.1);
}

.toast.info {
    border-left-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

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

/* Toast Content */
.toast-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    margin-right: 0.75rem !important;
    min-width: 0 !important;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast-message {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #94a3b8;
}

/* Toast Close Button */
.toast-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    padding: 0;
    opacity: 0.7;
}

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

.toast-close:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Toast Progress Bar - Removed: Now handled by Tailwind CSS */

/* Toast Actions */
.toast-actions {
    display: flex !important;
    gap: 0.5rem !important;
    margin-top: 0.5rem !important;
    flex-wrap: nowrap !important;
}

.toast-action-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: #f9fafb;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toast-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.toast-action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.toast.success .toast-action-btn {
    background-color: rgba(16, 185, 129, 0.2);
}

.toast.success .toast-action-btn:hover {
    background-color: rgba(16, 185, 129, 0.3);
}

.toast.error .toast-action-btn {
    background-color: rgba(239, 68, 68, 0.2);
}

.toast.error .toast-action-btn:hover {
    background-color: rgba(239, 68, 68, 0.3);
}

.toast.warning .toast-action-btn {
    background-color: rgba(245, 158, 11, 0.2);
}

.toast.warning .toast-action-btn:hover {
    background-color: rgba(245, 158, 11, 0.3);
}

.toast.info .toast-action-btn {
    background-color: rgba(59, 130, 246, 0.2);
}

.toast.info .toast-action-btn:hover {
    background-color: rgba(59, 130, 246, 0.3);
}

/* Toast Animations */
@keyframes toast-in {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-20px);
        opacity: 0;
    }
}

@keyframes toast-progress {
    0% {
        transform: scaleX(1);
    }
    100% {
        transform: scaleX(0);
    }
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .toast-container {
        width: 100%;
        padding: 0.5rem;
    }
    
    .toast {
        padding: 0.75rem;
    }
    
    .toast-container.top-center,
    .toast-container.bottom-center {
        width: calc(100% - 1rem);
        left: 0.5rem;
        transform: none;
    }
}

/* Dark Mode Adjustments */
.dark-mode .toast {
    background-color: #374151;
}

/* Light Mode Adjustments */
.light-mode .toast {
    background-color: #ffffff;
    color: #111827;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.light-mode .toast-message {
    color: #374151;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none !important;
        transition: none !important;
    }
    
    .toast-progress-bar {
        animation: none !important;
        transition: none !important;
    }
}
