/**
 * Copyright (c) 2024, 2025, 2026 Pavel Brychta
 * https://www.xpablo.cz
 * Licensed under the MIT License. See LICENSE file for details.
 */

/**
 * Custom Toast Enhancements for PapirLive
 *
 * Extends Bootstrap 5 toast component with custom animations and progress bar.
 * Most styling now provided by Bootstrap - this file contains only custom behavior.
 */

/* ====================
   Custom Toast Animations
   ==================== */

/* Initial state - hidden off-screen */
.toast {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
}

/* Shown state - slide in from right */
.toast.show {
    opacity: 1;
    transform: translateX(0);
    animation: slideInFromRight 0.3s ease-out;
}

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

/* ====================
   Custom Progress Bar
   ==================== */

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0.5rem 0.5rem;
    overflow: hidden;
    width: 100%;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation-name: toast-progress-animation;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

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

/* Progress bar color variants */
.toast.text-bg-success .toast-progress-bar {
    background: #198754;
}

.toast.text-bg-danger .toast-progress-bar {
    background: #dc3545;
}

.toast.text-bg-warning .toast-progress-bar {
    background: #ffc107;
}

.toast.text-bg-info .toast-progress-bar {
    background: #0dcaf0;
}

/* ====================
   Toast Icon Styling
   ==================== */

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Ensure icons inherit header color */
.toast-icon i {
    color: inherit;
}
