/**
 * Flex Toast styling (D4).
 *
 * Container: fixed top-right (desktop), bottom-center (mobile <576px).
 * Toast: bijeli card sa color-coded border-left + ikona + msg + close.
 * Animacije: slide-in 250ms ease-out, slide-out 250ms ease-in.
 *
 * Z-index 1080 → iznad Bootstrap modal-a (1055) i backdrop-a (1050)
 * tako da toast nikad ne ostane "ispod" modal-a.
 */

.flex-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none; /* container ne hvata klik; samo toast-ovi */
    max-width: 360px;
    width: calc(100% - 2rem);
}

.flex-toast {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .75rem 1rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-left: 4px solid #6c757d;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .25s ease-out, transform .25s ease-out;
}
.flex-toast--show {
    opacity: 1;
    transform: translateX(0);
}
.flex-toast--hide {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .25s ease-in, transform .25s ease-in;
}

.flex-toast__icon {
    flex: 0 0 auto;
    font-size: 1.1rem;
    line-height: 1.4;
}
.flex-toast__msg {
    flex: 1 1 auto;
    color: #212529;
    font-size: .9rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.flex-toast__close {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    font-size: 1.4rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    padding: 0 .25rem;
    margin-left: .25rem;
    opacity: .7;
    transition: opacity .15s, color .15s;
}
.flex-toast__close:hover {
    opacity: 1;
    color: #212529;
}

/* Type variants — border + icon color */
.flex-toast--success { border-left-color: #198754; }
.flex-toast--success .flex-toast__icon { color: #198754; }

.flex-toast--error { border-left-color: #dc3545; }
.flex-toast--error .flex-toast__icon { color: #dc3545; }

.flex-toast--warning { border-left-color: #ffc107; }
.flex-toast--warning .flex-toast__icon { color: #b38500; }

.flex-toast--info { border-left-color: #0d6efd; }
.flex-toast--info .flex-toast__icon { color: #0d6efd; }

/* Mobile <576px — full-width bottom-center stack */
@media (max-width: 575.98px) {
    .flex-toast-container {
        top: auto;
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
        max-width: none;
        width: auto;
    }
    .flex-toast {
        transform: translateY(20px);
    }
    .flex-toast--show { transform: translateY(0); }
    .flex-toast--hide { transform: translateY(20px); }
}

/* Reduced motion — disable transforms za korisnike sa motion sensitivity */
@media (prefers-reduced-motion: reduce) {
    .flex-toast,
    .flex-toast--show,
    .flex-toast--hide {
        transition: opacity .15s linear;
        transform: none;
    }
}
