:root {
    --almas-toast-bg: rgba(255, 255, 255, 0.96);
    --almas-toast-border: rgba(255, 255, 255, 0.7);
    --almas-toast-text: #1f2937;
    --almas-toast-muted: #6b7280;
    --almas-toast-success: #10b981;
    --almas-toast-error: #ef4444;
    --almas-toast-info: #3b82f6;
    --almas-toast-warning: #f59e0b;
}

body.dark-mode {
    --almas-toast-bg: rgba(23, 31, 46, 0.94);
    --almas-toast-border: rgba(255, 255, 255, 0.12);
    --almas-toast-text: #f3f4f6;
    --almas-toast-muted: #9ca3af;
}

#almas-toast-container {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: 320px;
    max-width: calc(100vw - 50px);
    will-change: transform, opacity;
}

#almas-toast-container.almas-toast-center {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

.almas-toast {
    background: var(--almas-toast-bg);
    backdrop-filter: blur(var(--almas-glass-blur, 16px)) saturate(var(--almas-glass-saturate, 150%));
    -webkit-backdrop-filter: blur(var(--almas-glass-blur, 16px)) saturate(var(--almas-glass-saturate, 150%));
    border: 1px solid var(--almas-toast-border);
    color: var(--almas-toast-text);
    padding: 14px 16px;
    border-radius: var(--almas-radius-element, 14px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    font-size: 13px;
    font-weight: 600;
    justify-content: space-between;
    transform: translateY(0) scale(1) translateZ(0);
    opacity: 1;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
    width: 100%;
    box-sizing: border-box;
    direction: rtl;
    font-family: inherit;
    contain: paint layout;
}

.almas-toast.almas-toast-enter {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
}

.almas-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.almas-toast-text {
    flex: 1;
    line-height: 1.5;
    word-break: break-word;
    text-align: right;
}

.almas-toast.success { border-right: 3px solid var(--almas-toast-success); }
.almas-toast.error { border-right: 3px solid var(--almas-toast-error); }
.almas-toast.info { border-right: 3px solid var(--almas-toast-info); }
.almas-toast.warning { border-right: 3px solid var(--almas-toast-warning); }

.almas-toast-close {
    background: transparent !important;
    border: none !important;
    color: var(--almas-toast-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.2s, transform 0.2s;
    box-shadow: none !important;
    margin: 0;
    outline: none;
    flex-shrink: 0;
}

@media (hover: hover) {
    .almas-toast-close:hover {
        color: var(--almas-toast-text);
        transform: scale(1.1);
        background: transparent !important;
    }
}

.almas-undo-btn {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--almas-primary, #6366f1);
    color: var(--almas-primary, #6366f1);
    border-radius: var(--almas-radius-button, 8px);
    font-weight: 700;
    cursor: pointer;
    font-size: 11px;
    padding: 4px 10px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    outline: none;
    font-family: inherit;
}

@media (hover: hover) {
    .almas-undo-btn:hover {
        background: var(--almas-primary, #6366f1);
        color: #fff;
    }
}

body.dark-mode .almas-undo-btn {
    border-color: #818cf8;
    color: #818cf8;
}

@media (hover: hover) {
    body.dark-mode .almas-undo-btn:hover {
        background: #818cf8;
        color: #fff;
    }
}

@media (max-width: 1024px) {
    #almas-toast-container {
        bottom: 90px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 90% !important;
        max-width: 360px !important;
    }
    .almas-toast,
    .almas-undo-btn {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .almas-toast {
        background: var(--almas-toast-bg) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .almas-toast,
    .almas-toast.almas-toast-enter {
        transition: opacity 0.15s ease;
    }
}