/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-stack {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--header-height) + 1rem);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 100;
    pointer-events: none;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    max-width: 440px;
    width: 100%;
    background: var(--surface-100);
    border-radius: var(--radius-card);
    padding: 0.9rem 1.1rem;
    box-shadow: 0 20px 50px -30px rgba(128, 10, 10, 0.65);
    border: 1px solid rgba(128, 10, 10, 0.12);
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
    transition: opacity 220ms ease-out, transform 220ms ease-out, box-shadow 180ms ease-out;
    pointer-events: auto;
    margin: 0 auto;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

.toast--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast--hiding {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
    box-shadow: 0 10px 30px -25px rgba(16, 23, 40, 0.5);
}

.toast__icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast__icon i {
    font-size: 1.25rem;
}

.toast__body {
    display: grid;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.toast__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-900);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    overflow: hidden;
}

.toast__message {
    font-size: 0.9rem;
    color: var(--text-700);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
    hyphens: auto;
    overflow: hidden;
}

.toast__close {
    border: none;
    background: transparent;
    color: var(--text-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease, transform 120ms ease;
    flex-shrink: 0;
    min-width: 2rem;
    min-height: 2rem;
}

.toast__close i {
    font-size: 1rem;
}

.toast__close:hover {
    background-color: rgba(128, 10, 10, 0.1);
    color: var(--brand-500);
}

.toast__close:active {
    transform: scale(0.96);
}

.toast--success {
    border-color: rgba(128, 10, 10, 0.18);
}

.toast--success .toast__icon {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #ffffff;
}

.toast--error {
    border-color: rgba(220, 38, 38, 0.18);
}

.toast--error .toast__icon {
    background: radial-gradient(circle at 20% 20%, #fee2e2, #dc2626);
    color: #ffffff;
}

.toast--warning {
    border-color: rgba(234, 179, 8, 0.18);
}

.toast--warning .toast__icon {
    background: radial-gradient(circle at 20% 20%, #fef3c7, #eab308);
    color: #ffffff;
}

/* ==========================================================================
   Toast Responsive Styles - Mobile & Tablet
   ========================================================================== */

/* Tablet and smaller desktop */
@media (max-width: 768px) {
    .toast-stack {
        top: calc(var(--header-height) + 0.75rem);
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .toast {
        max-width: 100%;
        padding: 0.85rem 1rem;
        gap: 0.75rem;
    }

    .toast__icon {
        width: 2.2rem;
        height: 2.2rem;
    }

    .toast__icon i {
        font-size: 1.15rem;
    }

    .toast__title {
        font-size: 0.9rem;
    }

    .toast__message {
        font-size: 0.85rem;
    }
}

/* Mobile devices */
@media (max-width: 640px) {
    .toast-stack {
        top: calc(var(--header-height) + 0.5rem);
        padding-left: 1rem;
        padding-right: 1rem;
        max-width: 100vw;
        width: 100vw;
        box-sizing: border-box;
        left: 0;
        right: 0;
    }

    .toast {
        width: calc(100% - 0rem);
        max-width: calc(100vw - 2rem);
        padding: 0.8rem 1rem;
        gap: 0.7rem;
        border-radius: 16px;
        margin: 0;
        box-sizing: border-box;
        min-width: 0;
        flex-shrink: 1;
    }

    .toast__icon {
        width: 2rem;
        height: 2rem;
    }

    .toast__icon i {
        font-size: 1.1rem;
    }

    .toast__body {
        gap: 0.15rem;
    }

    .toast__title {
        font-size: 0.875rem;
        line-height: 1.3;
    }

    .toast__message {
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .toast__close {
        min-width: 2.25rem;
        min-height: 2.25rem;
        padding: 0.25rem;
    }

    .toast__close i {
        font-size: 0.95rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .toast-stack {
        top: calc(var(--header-height) + 0.5rem);
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        max-width: 100vw;
        width: 100vw;
        box-sizing: border-box;
        left: 0;
        right: 0;
    }

    .toast {
        width: calc(100% - 0rem);
        max-width: calc(100vw - 1.5rem);
        padding: 0.75rem 0.9rem;
        gap: 0.65rem;
        border-radius: 14px;
        margin: 0;
        box-sizing: border-box;
        min-width: 0;
        flex-shrink: 1;
    }

    .toast__icon {
        width: 1.9rem;
        height: 1.9rem;
    }

    .toast__icon i {
        font-size: 1rem;
    }

    .toast__title {
        font-size: 0.85rem;
    }

    .toast__message {
        font-size: 0.775rem;
    }

    .toast__close {
        min-width: 2rem;
        min-height: 2rem;
    }
}

/* Very small mobile devices */
@media (max-width: 360px) {
    .toast-stack {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .toast {
        max-width: calc(100vw - 1rem);
        padding: 0.7rem 0.8rem;
        gap: 0.6rem;
    }

    .toast__icon {
        width: 1.8rem;
        height: 1.8rem;
    }

    .toast__icon i {
        font-size: 0.95rem;
    }

    .toast__title {
        font-size: 0.8rem;
    }

    .toast__message {
        font-size: 0.75rem;
    }
}

