/* ============================================
   TOAST NOTIFICATIONS SYSTEM
   ============================================ */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

/* Toast Base Styles */
.toast {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 320px;
    max-width: 500px;
    pointer-events: all;
    position: relative;
    overflow: hidden;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s ease;
}

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

.toast.removing {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 1, 1);
}

/* Toast Animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: currentColor;
    opacity: 0.3;
    animation: progressBar 5s linear;
    transform-origin: left;
}

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

/* Toast Icon */
.toast-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    animation: iconPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes iconPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Toast Content */
.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #0D1B2A;
}

.toast-message {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

/* Toast Types */

/* Success Toast */
.toast-success {
    border-left: 5px solid #10b981;
}

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

.toast-success .toast-progress {
    background: #10b981;
}

/* Error Toast */
.toast-error {
    border-left: 5px solid #ef4444;
}

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

.toast-error .toast-progress {
    background: #ef4444;
}

/* Warning Toast */
.toast-warning {
    border-left: 5px solid #f59e0b;
}

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

.toast-warning .toast-progress {
    background: #f59e0b;
}

/* Info Toast */
.toast-info {
    border-left: 5px solid #3b82f6;
}

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

.toast-info .toast-progress {
    background: #3b82f6;
}

/* Loading Toast */
.toast-loading {
    border-left: 5px solid #667eea;
}

.toast-loading .toast-icon {
    color: #667eea;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Compact Toast (for mobile) */
.toast-compact {
    min-width: 280px;
    padding: 1rem 1.25rem;
}

.toast-compact .toast-icon {
    font-size: 1.5rem;
}

.toast-compact .toast-title {
    font-size: 0.95rem;
}

.toast-compact .toast-message {
    font-size: 0.9rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .toast-container {
        top: 80px;
        right: 10px;
        left: 10px;
        align-items: stretch;
    }

    .toast {
        min-width: unset;
        max-width: unset;
        animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .toast.removing {
        animation: slideOutUp 0.3s cubic-bezier(0.4, 0, 1, 1);
    }

    @keyframes slideInDown {
        from {
            transform: translateY(-100px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes slideOutUp {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100px);
            opacity: 0;
        }
    }

    .toast:hover {
        transform: translateX(0);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1e293b;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    }

    .toast-title {
        color: #f1f5f9;
    }

    .toast-message {
        color: #cbd5e1;
    }

    .toast-close {
        color: #64748b;
    }

    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #94a3b8;
    }
}

/* Accessibility */
.toast:focus-within {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .toast-container {
        display: none;
    }
}
