/**
 * toast.css — Toast Notification Styles
 * Part of the AqAlert Design System (AQAABEYAN)
 *
 * Naming convention: BEM  →  .aq-toast__element--modifier
 * Matches alerts.php (AqAlert) design tokens exactly.
 *
 * @version 4.0.0
 */

/* ── Container ────────────────────────────────────────────────────────────── */
.aq-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none; /* container does not block page clicks */
}

/* ── Single Toast ─────────────────────────────────────────────────────────── */
.aq-toast {
    min-width: 340px;
    max-width: min(480px, calc(100vw - 40px));
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    pointer-events: auto;

    /* Entrance animation */
    animation: aq-toast-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.aq-toast.aq-toast--closing {
    animation: aq-toast-slide-out 0.3s ease-in forwards;
    pointer-events: none;
}

/* ── Inner layout ─────────────────────────────────────────────────────────── */
.aq-toast__body {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 14px;
}

/* ── Icon ─────────────────────────────────────────────────────────────────── */
.aq-toast__icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.18);
}

.aq-toast__icon-wrap i {
    font-size: 16px;
    color: #fff;
    pointer-events: none;
}

/* ── Content ──────────────────────────────────────────────────────────────── */
.aq-toast__content {
    flex: 1;
    min-width: 0;
    pointer-events: none;
}

.aq-toast__title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 3px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aq-toast__message {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
}

/* ── Close button ─────────────────────────────────────────────────────────── */
.aq-toast__close {
    align-self: flex-start;
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.15s, transform 0.15s;
    line-height: 1;
    pointer-events: auto;
}

.aq-toast__close:hover {
    color: #fff;
    transform: scale(1.15);
}

.aq-toast__close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.aq-toast__close svg {
    display: block;
}

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.aq-toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.aq-toast__progress-fill {
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.6);
    transform-origin: left;
    animation: aq-toast-progress linear forwards;
}

.aq-toast__progress-fill--paused {
    animation-play-state: paused;
}

/* ── Hover lift ───────────────────────────────────────────────────────────── */
.aq-toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s, box-shadow 0.2s;
}

.aq-toast.aq-toast--closing:hover {
    transform: none;
}

/* ── Type colours (matches alerts.php exactly) ────────────────────────────── */
.aq-toast--success { background: #22a65a; border-left: 4px solid #178a47; }
.aq-toast--danger  { background: #e03c4a; border-left: 4px solid #c42b39; }
.aq-toast--warning { background: #e68a00; border-left: 4px solid #c47600; }
.aq-toast--info    { background: #1a9db8; border-left: 4px solid #147f95; }
.aq-toast--primary { background: #3d6fd4; border-left: 4px solid #2f5ab8; }

/* ── Keyframes ────────────────────────────────────────────────────────────── */
@keyframes aq-toast-slide-in {
    from { transform: translateX(calc(100% + 24px)); opacity: 0; }
    to   { transform: translateX(0);                 opacity: 1; }
}

@keyframes aq-toast-slide-out {
    from { transform: translateX(0);                 opacity: 1; }
    to   { transform: translateX(calc(100% + 24px)); opacity: 0; }
}

@keyframes aq-toast-progress {
    from { width: 100%; }
    to   { width: 0%;   }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .aq-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        align-items: stretch;
    }

    .aq-toast {
        min-width: unset;
        width: 100%;
    }
}