/**
 * Toast Notification Styles
 * أنماط الإشعارات المنبثقة
 */

/* Container for toasts */
.toast-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none; /* Allow clicking through container */
}

/* Positioning classes */
.toast-container.top-right {
    top: 20px;
    right: 20px;
}

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

.toast-container.bottom-right {
    bottom: 20px;
    right: 20px;
    flex-direction: column-reverse; /* Stack upwards */
}

.toast-container.bottom-left {
    bottom: 20px;
    left: 20px;
    flex-direction: column-reverse; /* Stack upwards */
}

/* Toast Item */
.toast {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-right: 5px solid transparent; /* RTL support: border on right */
    opacity: 0;
    transform: translateX(0) scale(0.9);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bouncy effect */
    min-width: 320px;
    max-width: 450px;
    pointer-events: auto; /* Re-enable clicks on toasts */
    overflow: hidden;
    position: relative;
    font-family: 'Tahoma', sans-serif;
}

/* Animation States */
.toast.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%) scale(0.9); /* Slide out to right for RTL */
}

/* RTL Specific Animations */
[dir="rtl"] .toast.hide {
    transform: translateX(-100%) scale(0.9); /* Slide out to left for RTL */
}

/* Icon Styling */
.toast-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Message Styling */
.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    font-weight: 600;
}

/* Close Button */
.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    font-size: 14px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.toast-close:hover {
    color: #333;
    opacity: 1;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0; /* RTL: right is handled by dir="rtl" usually, but absolute needs specific */
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    transform-origin: right; /* RTL origin */
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    width: 100%;
    transition: width linear;
}

/* Toast Types & Colors */

/* Success */
.toast-success {
    border-right-color: #10b981;
}
.toast-success .toast-icon {
    color: #10b981;
}
.toast-success .toast-progress-bar {
    background-color: #10b981;
}

/* Error */
.toast-error {
    border-right-color: #ef4444;
}
.toast-error .toast-icon {
    color: #ef4444;
}
.toast-error .toast-progress-bar {
    background-color: #ef4444;
}

/* Warning */
.toast-warning {
    border-right-color: #f59e0b;
}
.toast-warning .toast-icon {
    color: #f59e0b;
}
.toast-warning .toast-progress-bar {
    background-color: #f59e0b;
}

/* Info */
.toast-info {
    border-right-color: #3b82f6;
}
.toast-info .toast-icon {
    color: #3b82f6;
}
.toast-info .toast-progress-bar {
    background-color: #3b82f6;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        width: 100%;
        padding: 0 10px;
        left: 0 !important;
        right: 0 !important;
        align-items: center;
    }
    
    .toast-container.top-right,
    .toast-container.top-left {
        top: 10px;
    }

    .toast-container.bottom-right,
    .toast-container.bottom-left {
        bottom: 10px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
        max-width: 100%;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}