/* Toast Container */
.toast-container {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
}

/* Positions */
.toast-container.top-right {
    top: 14px;
    right: 317px;
}

.toast-container.top-left {
    top: 20px;
    left: 20px;
}

.toast-container.bottom-right {
    bottom: 14px;
    right: 317px;
}

.toast-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

.toast-container.top-center {
    top: 20px;
    left: calc(100vw - 50% - 180px);
    transform: translateX(-50%);
}

.toast-container.bottom-center {
    bottom: 20px;
    left: calc(100vw - 50% - 210px);
    transform: translateX(-50%);
}

/* Toast Notification */
.toast {
    position: absolute;
    top: calc(var(--index) * 10px); /* Stacking logic */
    z-index: calc(100 - var(--index)); /* Ensures newer toasts are in front */
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    width: 420px;
    max-width: calc(100vw - 40px);
    border-radius: 8px;
    background-color: #333;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: scale(calc(1 - var(--index) * 0.05)); /* Scale effect for older toasts */
    transition: transform 0.4s ease, top 0.4s ease, box-shadow 0.4s ease, opacity 0.3s ease;
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    justify-content: space-between;
}
.toast:last-of-type {
    animation: toast-entry 0.5s ease-out forwards, fade-out 0.3s ease-out forwards;
}

/* Add Toast Entry Animation */
@keyframes toast-entry {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(calc(1 - var(--index) * 0.05));
    }
    50% {
        opacity: 0.8;
        transform: translateY(5px) scale(calc(1 - var(--index) * 0.02));
    }
    100% {
        opacity: 1;
        transform: translateY(calc(var(--index) * 0px)) scale(calc(1 - var(--index) * 0.05));
    }
}

/* Toast Types */
.toast.success {
    background-color: #31ad5a;
    border: 1px solid #2b8f4c;
}
.toast.error {
    background-color: #c82a1f;
    border: 1px solid #e8473b;
}
.toast.info { 
    background-color: #111111;
    border: 1px solid #1b1b1d;
}
.toast.prompt { 
    background-color: #ff9800;
    border: 1px solid #1b1b1d;
    color: #111111;
    display: block;
}
.toast.prompt input,
.toast.prompt input:focus,
.toast.prompt input:focus-visible { 
    border: 1px solid #1b1b1d;
    outline: none;
    color: #111111;
    display: block;
}
.toast.prompt input::placeholder { 
    color: #111111;
}
.toast.prompt .icon { 
    display: none;
}
.toast.warning {
    background-color: #ff9800;
    border: 1px solid #c67700;
    color: #111111;
}

.toast .icon {
    min-width: 20px;
    padding: 7px 2px 0;
}
.toast button {
    background-color: transparent;
    border: 1px solid #1b1b1d;
    color: inherit;
}

.toast .close-btn {
    margin-left: auto;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
}

/* Expand Hover Area */
.toast::before {
    content: "";
    position: absolute;
    top: -15px; /* Extend hover area upwards */
    left: -15px; /* Extend hover area to the left */
    right: -15px; /* Extend hover area to the right */
    bottom: -15px; /* Extend hover area downwards */
    z-index: -1; /* Keep behind the toast */
    pointer-events: all; /* Make it hover-sensitive */
}

/* Hover Effect - Unstack Toasts */
.toast-container:hover .toast {
    top: calc(var(--index) * 72px); /* Spread out toasts when hovering */
    transform: scale(1.0); /* Slightly enlarge the hovered toast */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.toast.fade-out {
    opacity: 0;
    transform: translateY(20px) scale(0.7); /* Adjust scale and translation for a better effect */
    box-shadow: none; /* Remove shadow for a clean exit */
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.1s ease;
}




.toast .confirmation-buttons {
    display: flex;
    gap: 10px;
}

.toast .confirm-btn,
.toast .cancel-btn {
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}

.toast .cancel-btn {
}

.toast-input-wrapper {
    margin: 10px 0;
}

.toast-input {
    width: calc(100% - 20px);
    padding: 5px;
    border: 1px solid #ccc;
    background-color: transparent;
    color: inherit;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}