/**
 * Joyn Resources - Toast Notifications
 * Design System: Soft & Minimal v3.0
 */

/* ========================================
   Toast Container
   ======================================== */
.joyn-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========================================
   Toast Base
   ======================================== */
.joyn-toast {
    min-width: 340px;
    max-width: 440px;
    padding: 16px 20px;
    background: var(--joyn-bg-white);
    border-radius: var(--joyn-radius-lg);
    box-shadow: var(--joyn-shadow-xl);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    pointer-events: auto;
    transform: translateX(calc(100% + 24px));
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--joyn-gray-100);
}

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

.joyn-toast.hide {
    transform: translateX(calc(100% + 24px));
    opacity: 0;
}

/* ========================================
   Toast Icon
   ======================================== */
.joyn-toast-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--joyn-radius-md);
}

.joyn-toast-icon svg,
.joyn-toast-icon i {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* ========================================
   Toast Content
   ======================================== */
.joyn-toast-content {
    flex: 1;
    font-family: var(--joyn-font-sans);
    font-size: var(--joyn-font-size-sm);
    font-weight: 500;
    line-height: 1.5;
    color: var(--joyn-gray-800);
    padding-top: 6px;
}

/* ========================================
   Toast Close Button
   ======================================== */
.joyn-toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--joyn-transition);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--joyn-gray-500);
    border-radius: var(--joyn-radius-sm);
}

.joyn-toast-close:hover {
    opacity: 1;
    background: var(--joyn-gray-100);
}

.joyn-toast-close i {
    font-size: 18px;
}

/* ========================================
   Toast Types
   ======================================== */

/* Success */
.joyn-toast.success {
    border-left: 4px solid var(--joyn-success);
}

.joyn-toast.success .joyn-toast-icon {
    background: var(--joyn-success-light);
    color: var(--joyn-success);
}

/* Error */
.joyn-toast.error {
    border-left: 4px solid var(--joyn-error);
}

.joyn-toast.error .joyn-toast-icon {
    background: var(--joyn-error-light);
    color: var(--joyn-error);
}

/* Warning */
.joyn-toast.warning {
    border-left: 4px solid var(--joyn-warning);
}

.joyn-toast.warning .joyn-toast-icon {
    background: var(--joyn-warning-light);
    color: #d97706;
}

/* Info */
.joyn-toast.info {
    border-left: 4px solid var(--joyn-info);
}

.joyn-toast.info .joyn-toast-icon {
    background: var(--joyn-info-light);
    color: var(--joyn-info);
}

/* ========================================
   Progress Bar
   ======================================== */
.joyn-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 0 var(--joyn-radius-lg);
    transition: width linear;
}

.joyn-toast.success .joyn-toast-progress {
    background: var(--joyn-success);
}

.joyn-toast.error .joyn-toast-progress {
    background: var(--joyn-error);
}

.joyn-toast.warning .joyn-toast-progress {
    background: var(--joyn-warning);
}

.joyn-toast.info .joyn-toast-progress {
    background: var(--joyn-info);
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 768px) {
    .joyn-toast-container {
        top: auto;
        bottom: 24px;
        right: 16px;
        left: 16px;
    }

    .joyn-toast {
        min-width: auto;
        max-width: none;
        transform: translateY(calc(100% + 24px));
    }

    .joyn-toast.show {
        transform: translateY(0);
    }

    .joyn-toast.hide {
        transform: translateY(calc(100% + 24px));
    }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .joyn-toast {
        transition: opacity 0.2s;
        transform: none !important;
    }

    .joyn-toast.show {
        transform: none !important;
    }

    .joyn-toast.hide {
        transform: none !important;
    }
}
