/* ======= Pagedinx Toast Notification System ======= */

.pdx-toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    max-width: 92vw;
    width: 440px;
}

.pdx-toast {
    pointer-events: auto;
    width: 100%;
    background-color: var(--bg-content);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 0.95rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: pdxToastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.25s ease, opacity 0.25s ease;
    overflow: hidden;
    position: relative;
}

.pdx-toast.hiding {
    animation: pdxToastSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes pdxToastSlideIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pdxToastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

.pdx-toast-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.pdx-toast-icon.error {
    background-color: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.pdx-toast-icon.warning {
    background-color: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.pdx-toast-icon.info {
    background-color: color-mix(in srgb, var(--custom2-color) 15%, transparent);
    color: var(--custom2-color);
    border: 1px solid color-mix(in srgb, var(--custom2-color) 30%, transparent);
}

.pdx-toast-content {
    flex: 1;
    min-width: 0;
}

.pdx-toast-title {
    font-family: "OpenSans-Semibold", sans-serif;
    font-weight: 600;
    font-size: 0.925rem;
    margin-bottom: 0.15rem;
    color: var(--text-main);
    line-height: 1.3;
}

.pdx-toast-message {
    font-size: 0.825rem;
    color: var(--text-light);
    line-height: 1.4;
    margin: 0;
}

.pdx-toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    padding: 0;
    flex-shrink: 0;
}

.pdx-toast-close:hover {
    background-color: var(--bg-secondary);
    color: var(--text-main);
}

/* Progress bar */
.pdx-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: #ef4444;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    width: 100%;
    animation: pdxToastProgress linear forwards;
}

.pdx-toast.warning .pdx-toast-progress {
    background-color: #f59e0b;
}

.pdx-toast.info .pdx-toast-progress {
    background-color: var(--custom2-color);
}

@keyframes pdxToastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Dark Mode */
[data-theme="dark"] .pdx-toast {
    background-color: rgba(30, 41, 59, 0.92);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .pdx-toast-title {
    color: #f8fafc;
}

[data-theme="dark"] .pdx-toast-message {
    color: #94a3b8;
}

[data-theme="dark"] .pdx-toast-close {
    color: #64748b;
}

[data-theme="dark"] .pdx-toast-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}
