﻿/* =========================================
   09 - Feedback
   ========================================= */

.app-loader {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-3);
    color: var(--primary);
}

.app-loader--center {
    display: flex;
    width: 100%;
}

.app-loader__svg {
    display: block;
    height: auto;
}

.app-loader__svg--sm {
    width: 2rem;
}

.app-loader__svg--md {
    width: 3rem;
}

.app-loader__svg--lg {
    width: 4rem;
}

.app-loader__group {
    stroke: currentColor;
}

.app-loader__label {
    font-size: var(--text-sm);
    line-height: var(--line-normal);
    color: var(--text-2);
    text-align: center;
}

/* =========================================
   Toast host
   ========================================= */

.app-toast-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    top: 1rem;
    z-index: 1200;
    pointer-events: none;
    display: flex;
    flex-direction: column-reverse;
    flex-wrap: wrap;
    align-content: flex-end;
    gap: 0.75rem;
    max-height: calc(100dvh - 2rem);
    max-width: calc(100vw - 2rem);
}

.app-toast {
    width: 340px;
    max-width: calc(100vw - 2rem);
    pointer-events: auto;
    border: 1px solid rgba(32, 64, 154, 0.10);
    border-radius: 1rem;
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 18px 36px rgba(2, 0, 53, 0.18);
    overflow: hidden;
    animation: app-toast-enter 160ms ease-out;
}

.app-toast__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1rem 0.65rem 1rem;
}

.app-toast__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}

.app-toast__icon {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 0.35rem;
    background: var(--primary);
    flex: 0 0 auto;
}

.app-toast__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1 1 auto;
}

.app-toast__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    white-space: nowrap;
}

.app-toast__time {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.app-toast__close {
    flex: 0 0 auto;
}

    .app-toast__close.app-modal__close {
        width: 1.75rem;
        height: 1.75rem;
        min-width: 1.75rem;
        min-height: 1.75rem;
        padding: 0;
        font-size: 1rem;
        line-height: 1;
    }

.app-toast--default .app-toast__icon,
.app-toast--info .app-toast__icon {
    background: var(--primary);
}

.app-toast--success .app-toast__icon {
    background: var(--success);
}

.app-toast--warning .app-toast__icon {
    background: var(--warning);
}

.app-toast--error .app-toast__icon {
    background: var(--accent);
}

.app-toast__body {
    padding: 0 1rem 1rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-2);
}

@keyframes app-toast-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .app-toast-host {
        right: 0.75rem;
        bottom: 0.75rem;
        top: 0.75rem;
        gap: 0.65rem;
        max-height: calc(100dvh - 1.5rem);
        max-width: calc(100vw - 1.5rem);
    }

    .app-toast {
        width: min(340px, calc(100vw - 1.5rem));
    }

    .app-toast__title-wrap {
        flex-wrap: wrap;
        gap: 0.35rem 0.6rem;
    }
}
