/* Toast Message Styles - Interactive iOS/Meta Stack Style */

:root {
    --toast-bg-light: #ffffff;
    --toast-bg-dark: #121212;
    --toast-text-light: #1e293b;
    --toast-text-dark: #f8fafc;
    --toast-border-light: rgba(0, 0, 0, 0.08);
    --toast-border-dark: rgba(255, 255, 255, 0.1);
    --toast-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Base Toast Style */
.toast-success,
.toast-info,
.toast-warning,
.toast-error {
    width: auto !important;
    min-width: 320px !important;
    max-width: 450px !important;
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 50px !important;
    /* Pill Shape */
    padding: 12px 20px 12px 55px !important;
    margin-bottom: 8px !important;
    position: relative;
    border: 1px solid var(--toast-border-light) !important;
    background-color: var(--toast-bg-light) !important;
    color: var(--toast-text-light) !important;
    box-shadow: var(--toast-shadow) !important;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    backdrop-filter: blur(10px);
}

/* Dark Mode Support */
[data-skin="dark"] .toast-success,
[data-skin="dark"] .toast-info,
[data-skin="dark"] .toast-warning,
[data-skin="dark"] .toast-error,
.dark-mode .toast-success,
.dark-mode .toast-info,
.dark-mode .toast-warning,
.dark-mode .toast-error {
    background-color: var(--toast-bg-dark) !important;
    color: var(--toast-text-dark) !important;
    border-color: var(--toast-border-dark) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

@media (prefers-color-scheme: dark) {

    .toast-success,
    .toast-info,
    .toast-warning,
    .toast-error {
        background-color: var(--toast-bg-dark) !important;
        color: var(--toast-text-dark) !important;
        border-color: var(--toast-border-dark) !important;
    }
}

/* Close Button (Small Circular X) */
.toast-close-button {
    display: flex !important;
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    background: #000 !important;
    color: #fff !important;
    border-radius: 50% !important;
    font-size: 10px !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    padding: 0 !important;
    border: none !important;
    cursor: pointer !important;
}

[data-skin="dark"] .toast-close-button,
.dark-mode .toast-close-button {
    background: #fff !important;
    color: #000 !important;
}

/* Icons Style Matching Image */
.toast-success::before,
.toast-info::before,
.toast-warning::before,
.toast-error::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 400;
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1.5px solid transparent;
}

.toast-success::before {
    content: "\f058";
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

.toast-info::before {
    content: "\f129";
    font-weight: 900;
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
    font-size: 0.8rem;
}

.toast-warning::before {
    content: "\f0ad";
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.toast-error::before {
    content: "\f0e7";
    font-weight: 900;
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

#toast-container {
    z-index: 10000;
    position: fixed;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

/* Positioning Responsive Logic */
.toast-bottom-center {
    bottom: 30px !important;
    left: 50% !important;
    transform: translateX(-50%);
}

.toast-top-right {
    top: 30px !important;
    right: 30px !important;
    flex-direction: column;
    /* Stack downwards on desktop top-right */
}

/* Animations */
@keyframes interactSlideUp {
    0% {
        transform: translateY(50px) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes interactSlideRight {
    0% {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }

    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Apply animations based on position */
.toast-bottom-center>.toast {
    animation: interactSlideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards !important;
}

.toast-top-right>.toast {
    animation: interactSlideRight 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards !important;
}

#toast-container>.toast {
    background-image: none !important;
}

/* Stacking Effect */
#toast-container.toast-bottom-center>.toast:nth-last-child(n+2) {
    transform: translateY(-12px) scale(0.95);
    opacity: 0.85;
}

#toast-container.toast-bottom-center>.toast:nth-last-child(n+3) {
    transform: translateY(-20px) scale(0.9);
    opacity: 0.7;
}

@media (max-width: 480px) {

    .toast-success,
    .toast-info,
    .toast-warning,
    .toast-error {
        min-width: 92vw !important;
    }
}