@use '../variables' as *;

.proddisp-toast-container {
    position: fixed;
    top: 32px; // Account for WordPress admin bar
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: $spacing-md;
    pointer-events: none;
}

.proddisp-toast {
    background: $white;
    border-radius: $border-radius-lg;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: $spacing-lg;
    min-width: 350px;
    max-width: 450px;
    display: flex;
    align-items: center;
    gap: $spacing-md;
    pointer-events: auto;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid $border-color;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 4px;
        background: currentColor;
    }

    &.toast-success {
        color: $success-color;
        
        .toast-icon {
            background: rgba($success-color, 0.1);
            color: $success-color;
        }
    }

    &.toast-error {
        color: $danger-color;
        
        .toast-icon {
            background: rgba($danger-color, 0.1);
            color: $danger-color;
        }
    }

    &.toast-warning {
        color: $warning-color;
        
        .toast-icon {
            background: rgba($warning-color, 0.1);
            color: $warning-color;
        }
    }

    &.toast-info {
        color: $primary-color;
        
        .toast-icon {
            background: rgba($primary-color, 0.1);
            color: $primary-color;
        }
    }

    .toast-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: $border-radius-full;
        flex-shrink: 0;
        transition: $transition;

        i {
            font-size: 18px;
        }
    }

    .toast-content {
        flex: 1;

        .toast-message {
            font-size: 15px;
            color: $text-dark;
            line-height: 1.5;
            font-weight: 500;
            margin: 0;
        }
    }

    .toast-close {
        background: none;
        border: none;
        padding: $spacing-xs;
        cursor: pointer;
        color: $text-light;
        border-radius: $border-radius-full;
        transition: $transition;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        flex-shrink: 0;

        &:hover {
            background: $background-light;
            color: $text-dark;
            transform: scale(1.1);
        }

        i {
            font-size: 14px;
        }
    }

    // Progress bar animation
    &::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        height: 3px;
        background: currentColor;
        opacity: 0.3;
        animation: progressBar 3s linear;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

// Hover effects
.proddisp-toast {
    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);

        &::after {
            animation-play-state: paused;
        }
    }
}

// Responsive adjustments
@media (max-width: $tablet) {
    .proddisp-toast-container {
        right: 15px;
        left: 15px;
        top: 20px;
    }

    .proddisp-toast {
        min-width: auto;
        max-width: none;
        padding: $spacing-md;

        .toast-icon {
            width: 36px;
            height: 36px;

            i {
                font-size: 16px;
            }
        }

        .toast-content .toast-message {
            font-size: 14px;
        }

        .toast-close {
            width: 28px;
            height: 28px;

            i {
                font-size: 12px;
            }
        }
    }
}

@media (max-width: $mobile) {
    .proddisp-toast-container {
        right: 10px;
        left: 10px;
        top: 15px;
    }

    .proddisp-toast {
        padding: $spacing-sm $spacing-md;
        min-width: auto;

        .toast-icon {
            width: 32px;
            height: 32px;

            i {
                font-size: 14px;
            }
        }

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