/**
 * Toast Notifications Component
 * 
 * @package Artur_Developer
 */

/* Toast Container - bottom right */
#toast-container {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
}

/* Individual Toast */
.toast {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 300px;
    max-width: 420px;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-hide {
    transform: translateX(120%);
    opacity: 0;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

/* Toast Types */
.toast-success {
    border-color: #22c55e;
}

.toast-success .toast-icon {
    color: #22c55e;
}

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

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

.toast-info {
    border-color: var(--color-primary);
}

.toast-info .toast-icon {
    color: var(--color-primary);
}

/* Toast Message */
.toast-message {
    flex: 1;
    font-size: var(--text-sm);
    color: #fff;
    line-height: 1.4;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--color-bg-tertiary);
    color: #fff;
}

/* Button Loading Spinner */
.btn-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 480px) {
    #toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
        bottom: var(--spacing-md);
    }

    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}
