﻿.custom-toast-container {
    position: fixed;
    top: 120px;
    right: 20px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.clean-toast {
    --toast-accent: #cea277;
    --toast-glow: rgba(206, 162, 119, 0.35);
    background: linear-gradient(150deg, rgba(20, 23, 28, 0.96), rgba(26, 30, 36, 0.93)) !important;
    color: #f6f5f5 !important;
    border: 1px solid rgba(206, 162, 119, 0.18) !important;
    border-radius: 18px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(206, 162, 119, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
    font-size: 0.88rem;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    overflow: hidden;
    position: relative;
    pointer-events: auto;
    animation: toastSlideIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    will-change: transform, opacity;
}

    .clean-toast:hover {
        transform: translateY(-3px) scale(1.01);
        border-color: rgba(206, 162, 119, 0.4) !important;
        box-shadow: 0 28px 65px rgba(0, 0, 0, 0.6), 0 8px 24px var(--toast-glow), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    }

    .clean-toast::before {
        content: '';
        position: absolute;
        top: 10px;
        bottom: 10px;
        inset-inline-end: 0;
        width: 4px;
        border-radius: 4px;
        z-index: 2;
    }

    .clean-toast::after {
        content: '';
        position: absolute;
        inset: -50%;
        background: radial-gradient(circle at 30% 15%, rgba(206, 162, 119, 0.08) 0%, transparent 45%), radial-gradient(circle at 85% 90%, rgba(206, 162, 119, 0.05) 0%, transparent 40%);
        pointer-events: none;
        z-index: 0;
    }

    .clean-toast > * {
        position: relative;
        z-index: 1;
    }

    .clean-toast.toast-success {
        --toast-accent: #2ecc71;
        --toast-glow: rgba(46, 204, 113, 0.25);
    }

        .clean-toast.toast-success::before {
            background: linear-gradient(180deg, #3ee68a, #27ae60);
            box-shadow: 0 0 16px rgba(46, 204, 113, 0.55);
        }

    .clean-toast.toast-error {
        --toast-accent: #ff5a7a;
        --toast-glow: rgba(255, 90, 122, 0.25);
    }

        .clean-toast.toast-error::before {
            background: linear-gradient(180deg, #ff7292, #e74c3c);
            box-shadow: 0 0 16px rgba(255, 90, 122, 0.55);
        }

    .clean-toast .bi-check-circle-fill,
    .clean-toast .bi-exclamation-triangle-fill {
        font-size: 1.35rem;
        flex-shrink: 0;
        animation: toastIconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
    }

    .clean-toast .bi-check-circle-fill {
        color: #2ecc71;
        filter: drop-shadow(0 0 10px rgba(46, 204, 113, 0.5));
    }

    .clean-toast .bi-exclamation-triangle-fill {
        color: #ff5a7a;
        filter: drop-shadow(0 0 10px rgba(255, 90, 122, 0.5));
    }

    .clean-toast .toast-body {
        padding: 15px 18px !important;
        gap: 12px !important;
        display: flex;
        align-items: center;
    }

    .clean-toast .fw-medium {
        font-weight: 600;
        font-size: 0.9rem;
        line-height: 1.7;
        letter-spacing: -0.2px;
        overflow-wrap: anywhere;
    }

    .clean-toast .btn-close-custom {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: #8a8d90;
        font-size: 0.9rem;
        cursor: pointer;
        padding: 6px;
        line-height: 1;
        border-radius: 10px;
        width: 28px;
        height: 28px;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

        .clean-toast .btn-close-custom:hover {
            color: #f6f5f5;
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(206, 162, 119, 0.35);
            transform: rotate(90deg) scale(1.05);
        }

        .clean-toast .btn-close-custom:active {
            transform: rotate(90deg) scale(0.92);
        }

        .clean-toast .btn-close-custom:focus-visible {
            outline: 2px solid var(--toast-accent);
            outline-offset: 2px;
        }

    .clean-toast .toast-progress {
        position: absolute;
        bottom: 0;
        inset-inline: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--toast-accent), transparent);
        opacity: 0.7;
        transform-origin: right;
        animation: toastProgress var(--toast-duration, 4s) linear forwards;
        z-index: 2;
    }

    .clean-toast:hover .toast-progress {
        animation-play-state: paused;
    }

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(70px) scale(0.92);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(70px) scale(0.92);
        filter: blur(4px);
    }
}

@keyframes toastIconPop {
    from {
        opacity: 0;
        transform: scale(0.3) rotate(-12deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.clean-toast.hide-anim {
    animation: toastSlideOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@media (max-width: 768px) {
    .custom-toast-container {
        top: calc(85px + env(safe-area-inset-top, 0px));
        bottom: auto;
        right: 12px;
        left: 12px;
        max-width: none;
        width: auto;
        gap: 10px;
    }

    .clean-toast {
        font-size: 0.84rem;
        border-radius: 16px !important;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    }

        .clean-toast:hover {
            transform: none;
        }

        .clean-toast .toast-body {
            padding: 12px 14px !important;
            gap: 10px !important;
        }

        .clean-toast .fw-medium {
            font-size: 0.84rem;
            line-height: 1.6;
        }

        .clean-toast .bi-check-circle-fill,
        .clean-toast .bi-exclamation-triangle-fill {
            font-size: 1.2rem;
        }

        .clean-toast .btn-close-custom {
            width: 36px;
            height: 36px;
            border-radius: 12px;
        }

    @keyframes toastSlideIn {
        from {
            opacity: 0;
            transform: translateY(-50px) scale(0.94);
            filter: blur(3px);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
            filter: blur(0);
        }
    }

    @keyframes toastSlideOut {
        to {
            opacity: 0;
            transform: translateY(-50px) scale(0.94);
            filter: blur(3px);
        }
    }
}

@media (max-width: 380px) {
    .custom-toast-container {
        right: 8px;
        left: 8px;
    }

    .clean-toast .toast-body {
        padding: 10px 12px !important;
    }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    .custom-toast-container {
        left: auto;
        right: 16px;
        top: 64px;
        bottom: auto;
        max-width: 360px;
    }
}

@supports not (backdrop-filter: blur(1px)) {
    .clean-toast {
        background: linear-gradient(150deg, rgba(18, 21, 25, 0.99), rgba(24, 28, 33, 0.99)) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .clean-toast,
    .clean-toast.hide-anim,
    .clean-toast .bi-check-circle-fill,
    .clean-toast .bi-exclamation-triangle-fill,
    .clean-toast .toast-progress {
        animation: none !important;
        transition: none !important;
    }

        .clean-toast:hover,
        .clean-toast .btn-close-custom:hover {
            transform: none;
        }
}
