/* Live Toast CSS - Updated for Position Support */

#live-toast-container {
    position: fixed;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Positions */
#live-toast-container.top-right {
    top: 80px;
    right: 20px;
}

#live-toast-container.top-left {
    top: 80px;
    left: 20px;
}

#live-toast-container.top-center {
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
}

#live-toast-container.bottom-right {
    bottom: 20px;
    right: 20px;
    flex-direction: column-reverse;
}

#live-toast-container.bottom-left {
    bottom: 20px;
    left: 20px;
    flex-direction: column-reverse;
}

#live-toast-container.bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column-reverse;
}


/* Mobile */
@media (max-width: 768px) {
    #live-toast-container {
        top: auto !important;
        bottom: 80px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: calc(100% - 20px) !important;
        transform: none !important;
        flex-direction: column-reverse !important;
        z-index: 9999999 !important;
    }

    .live-toast {
        min-width: unset !important;
        width: 100% !important;
        animation: liveToastSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    .live-toast.hiding {
        animation: liveToastSlideDown 0.3s ease forwards !important;
    }
}

@keyframes liveToastSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes liveToastSlideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(100%) scale(0.8);
    }
}

/* Base Toast Style */
.live-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: liveToastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 320px;
    overflow: hidden;
    position: relative;
}

.live-toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.live-toast.hiding {
    animation: liveToastSlideOut 0.3s ease forwards;
}

/* Icon */
.live-toast-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.live-toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.live-toast-message {
    font-size: 0.85rem;
    opacity: 0.85;
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
}

.live-toast-time {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 6px;
    display: block;
}

/* Actions */
.live-toast-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.live-toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 4px;
    font-size: 1.1rem;
}

.live-toast-close:hover {
    opacity: 1;
}

.live-toast-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: inherit;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.live-toast-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.02);
}

/* Types/Colors */
.live-toast.toast-finance {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.95), rgba(22, 160, 133, 0.9));
    color: white;
}

.live-toast.toast-finance .live-toast-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.live-toast.toast-order {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.95), rgba(142, 68, 173, 0.9));
    color: white;
}

.live-toast.toast-order .live-toast-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.live-toast.toast-alert {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.95), rgba(192, 57, 43, 0.9));
    color: white;
}

.live-toast.toast-alert .live-toast-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.live-toast.toast-support {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.95), rgba(41, 128, 185, 0.9));
    color: white;
}

.live-toast.toast-support .live-toast-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.live-toast.toast-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(79, 70, 229, 0.9));
    color: white;
}

.live-toast.toast-info .live-toast-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Progress Bar */
.live-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    animation: liveToastProgress var(--toast-duration, 8s) linear forwards;
}

/* Animations */
@keyframes liveToastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }

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

@keyframes liveToastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

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

@keyframes liveToastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Pulse for Alerts */
.live-toast.toast-alert .live-toast-icon {
    animation: iconPulse 1s ease-in-out infinite;
}

@keyframes iconPulse {

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

    50% {
        transform: scale(1.1);
    }
}