/**
 * Toast Notification Styles
 * Clean, accessible, and readable toast notifications
 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 450px;
    min-width: 320px;
    pointer-events: none;
}

/* Base Toast Styles */
.toast {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    min-height: 56px;
    max-width: 100%;
    word-wrap: break-word;
    pointer-events: auto;
    transition: all 0.3s ease-in-out;
    transform: translateX(0);
    opacity: 1;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Toast Body */
.toast-body {
    flex: 1;
    margin-right: 1rem;
    color: inherit;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Close Button */
.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    opacity: 0.8;
    cursor: pointer;
    padding: 0.25rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

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

.toast-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Toast Type Styles */
.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-left: 5px solid #047857;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    border-left: 5px solid #b91c1c;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border-left: 5px solid #b45309;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    border-left: 5px solid #1d4ed8;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Animation States */
.toast.show {
    opacity: 1;
    transform: translateX(0) scale(1);
    animation: slideInScale 0.4s ease-out, subtlePulse 0.6s ease-out 0.4s;
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
}

/* Slide in animation with scale */
@keyframes slideInScale {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Subtle pulse animation for attention */
@keyframes subtlePulse {

    0%,
    100% {
        transform: translateX(0) scale(1);
    }

    50% {
        transform: translateX(0) scale(1.02);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .toast-container {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
        min-width: auto;
    }

    .toast {
        font-size: 0.95rem;
        padding: 0.875rem 1rem;
        min-height: 52px;
    }

    .toast-body {
        font-size: 0.95rem;
    }

    .toast-close {
        width: 26px;
        height: 26px;
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
    }

    .toast {
        font-size: 0.9rem;
        padding: 0.75rem 0.875rem;
        min-height: 48px;
    }

    .toast-body {
        font-size: 0.9rem;
    }

    .toast-close {
        width: 24px;
        height: 24px;
        font-size: 1.3rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .toast {
        border: 2px solid currentColor;
    }

    .toast-success {
        background-color: #065f46;
        border-color: #10b981;
    }

    .toast-error {
        background-color: #7f1d1d;
        border-color: #ef4444;
    }

    .toast-warning {
        background-color: #78350f;
        border-color: #f59e0b;
    }

    .toast-info {
        background-color: #1e3a8a;
        border-color: #3b82f6;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: none;
    }
}

/* Focus Management */
.toast:focus-within {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Ensure no unwanted content or pseudo-elements */
.toast::before,
.toast::after,
.toast *::before,
.toast *::after {
    content: none !important;
    display: none !important;
}

/* Remove any list styling that might be inherited */
.toast,
.toast * {
    list-style: none !important;
    list-style-type: none !important;
    text-decoration: none !important;
}

/* Ensure proper text rendering */
.toast-body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}