/**
 * Toast Notification Styles
 * Modern, accessible toast notifications for Coeur Astral
 */

/* Container - bottom right positioning */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    max-width: 380px;
    pointer-events: none;
}

/* Individual toast */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    padding-right: 40px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: none;
}

/* Visible state */
.toast.toast-visible {
    opacity: 1;
    transform: translateX(0);
    animation: toast-slide-in 0.3s ease-out;
}

/* Hiding state */
.toast.toast-hiding {
    animation: toast-slide-out 0.25s ease-in forwards;
}

/* Slide in animation */
@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide out animation */
@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Toast types - colored left border */
.toast-success {
    border-left: 4px solid #22c55e;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

/* Icon container */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Icon colors per type */
.toast-success .toast-icon i {
    color: #22c55e;
}

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

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

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

/* Content area */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #ffffff;
    word-wrap: break-word;
}

.toast-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    color: #6b7280;
}

/* Close button */
.toast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.toast-close:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.toast-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.toast-close i {
    font-size: 14px;
    color: #9ca3af;
    transition: color 0.15s ease;
}

.toast-close:hover i {
    color: #6b7280;
}

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: 0.3;
    animation: toast-progress linear forwards;
    transform-origin: left;
}

.toast-success .toast-progress {
    background: #22c55e;
}

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

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

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

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast.toast-visible,
    .toast.toast-hiding {
        animation: none;
        transition: opacity 0.15s ease;
    }

    .toast {
        transform: translateX(0);
    }

    .toast.toast-hiding {
        opacity: 0;
    }

    .toast-progress {
        animation: none;
        transform: scaleX(0);
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .toast {
        padding: 14px;
        padding-right: 36px;
    }

    .toast-message {
        font-size: 13px;
    }

    .toast-subtitle {
        font-size: 12px;
    }
}

/* Dark mode support for the project's dark background */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1e293b;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
    }

    .toast-message {
        color: #f1f5f9;
    }

    .toast-subtitle {
        color: #94a3b8;
    }

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

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

    .toast-close:hover i {
        color: #94a3b8;
    }
}
