/* =============================================
   GLOBAL TOAST BİLDİRİMİ
   ============================================= */

@keyframes toast-enter {
    from {
        opacity: 0;
        transform: translate(0.75rem, -0.5rem);
    }

    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

@keyframes toast-exit {
    from {
        opacity: 1;
        transform: translate(0, 0);
    }

    to {
        opacity: 0;
        transform: translate(0.75rem, -0.5rem);
    }
}

.toast {
    --toast-icon-bg: #fde8ec;
    --toast-icon-color: #ef4444;

    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    left: auto;
    z-index: 1200;
    width: min(calc(100vw - 3rem), 28rem);
    pointer-events: none;
    transform: none;
}

.toast.is-visible {
    pointer-events: auto;
    animation: toast-enter 0.35s ease forwards;
}

.toast.is-hiding {
    pointer-events: none;
    animation: toast-exit 0.28s ease forwards;
}

.toast.is-hidden {
    display: none;
}

.toast__inner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.65rem 0.65rem 0.85rem;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.04),
        0 14px 32px rgba(15, 23, 42, 0.12);
}

.toast__icon-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: var(--toast-icon-bg);
    color: var(--toast-icon-color);
}

.toast__icon {
    display: none;
}

.toast--error .toast__icon--error,
.toast--success .toast__icon--success,
.toast--warning .toast__icon--warning {
    display: block;
}

.toast__message {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: #111111;
}

.toast__action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.35rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, #3566df 0%, #6c8ceb 100%);
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(53, 102, 223, 0.35);
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.toast__action:hover {
    color: #ffffff;
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 6px 18px rgba(53, 102, 223, 0.45);
}

.toast__action svg {
    flex-shrink: 0;
}

.toast__action.is-hidden {
    display: none;
}

/* ---- Varyantlar ---- */

.toast--error {
    --toast-icon-bg: #fde8ec;
    --toast-icon-color: #ef4444;
}

.toast--success {
    --toast-icon-bg: #e8f8ef;
    --toast-icon-color: #16a34a;
}

.toast--warning {
    --toast-icon-bg: #fff4e5;
    --toast-icon-color: #ea580c;
}

@media (max-width: 639px) {
    .toast {
        top: 1rem;
        right: 1rem;
        width: min(calc(100vw - 2rem), 28rem);
    }

    .toast__inner {
        gap: 0.65rem;
        padding: 0.55rem 0.55rem 0.55rem 0.7rem;
    }

    .toast__icon-wrap {
        width: 2.15rem;
        height: 2.15rem;
        border-radius: 0.55rem;
    }

    .toast__icon {
        width: 16px;
        height: 16px;
    }

    .toast__message {
        font-size: 0.8125rem;
    }

    .toast__action {
        min-height: 2.1rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast.is-visible,
    .toast.is-hiding {
        animation: none;
    }
}

/* ---- Demo tetikleyiciler (geliştirme) ---- */

.demo-toast-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.demo-toast-trigger:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.demo-toast-trigger--error {
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
}

.demo-toast-trigger--success {
    background: linear-gradient(90deg, #15803d 0%, #22c55e 100%);
}

.demo-toast-trigger--warning {
    background: linear-gradient(90deg, #ea580c 0%, #f97316 100%);
}
