/**
 * Modern Toast Notification Styles
 * Version: 1.0.0
 */

/* Toast Container */
.toast-container {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 100vh;
    overflow: hidden;
}

/* Position variants */
.toast-top-left {
    top: 0;
    left: 0;
    align-items: flex-start;
}

.toast-top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.toast-top-right {
    top: 0;
    right: 0;
    align-items: flex-end;
}

.toast-bottom-left {
    bottom: 0;
    left: 0;
    align-items: flex-start;
    flex-direction: column-reverse;
}

.toast-bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
    flex-direction: column-reverse;
}

.toast-bottom-right {
    bottom: 0;
    right: 0;
    align-items: flex-end;
    flex-direction: column-reverse;
}

/* Toast Notification */
.toast-notification {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 280px;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Left-side positioned toasts */
.toast-top-left .toast-notification,
.toast-bottom-left .toast-notification {
    transform: translateX(-120%);
}

/* Center positioned toasts */
.toast-top-center .toast-notification,
.toast-bottom-center .toast-notification {
    transform: translateY(-30px);
}

/* Bottom positioned animation adjustment */
.toast-bottom-left .toast-notification,
.toast-bottom-center .toast-notification,
.toast-bottom-right .toast-notification {
    transform: translateY(30px);
}

.toast-bottom-left .toast-notification {
    transform: translateX(-120%);
}

.toast-bottom-right .toast-notification {
    transform: translateX(120%);
}

/* Visible state */
.toast-notification.toast-visible {
    transform: translateX(0) translateY(0);
    opacity: 1;
}

/* Hiding animation */
.toast-notification.toast-hiding {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
    transition: all 0.3s ease-in;
}

.toast-top-left .toast-notification.toast-hiding,
.toast-bottom-left .toast-notification.toast-hiding {
    transform: translateX(-120%) scale(0.9);
}

/* Dark Theme (default) */
.toast-theme-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Light Theme */
.toast-theme-light {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toast-icon svg {
    width: 24px;
    height: 24px;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.toast-message {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Close Button */
.toast-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin: -4px -4px -4px 4px;
}

.toast-theme-dark .toast-close {
    color: #94a3b8;
}

.toast-theme-light .toast-close {
    color: #64748b;
}

.toast-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.toast-close:active {
    transform: scale(0.95);
}

.toast-close svg {
    width: 18px;
    height: 18px;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 0 0 10px 10px;
    opacity: 0.8;
}

/* Type-specific styling enhancements */
.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

/* Light theme type borders */
.toast-theme-light.toast-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.toast-theme-light.toast-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.toast-theme-light.toast-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.toast-theme-light.toast-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

/* Responsive */
@media (max-width: 480px) {
    .toast-container {
        padding: 10px;
        width: 100%;
    }
    
    .toast-notification {
        min-width: unset;
        max-width: 100%;
        width: 100%;
    }
    
    .toast-top-center,
    .toast-bottom-center {
        left: 0;
        transform: none;
        width: 100%;
    }
}

/* Animation for stacking */
@keyframes toast-slide-down {
    from {
        transform: translateY(-10px);
        opacity: 0.8;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Accessibility - reduce motion */
@media (prefers-reduced-motion: reduce) {
    .toast-notification {
        transition: opacity 0.2s ease;
    }
    
    .toast-notification.toast-visible {
        transform: none;
    }
    
    .toast-notification.toast-hiding {
        transform: none;
    }
}

/* Print - hide toasts */
@media print {
    .toast-container {
        display: none !important;
    }
}
