.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast {
    position: relative;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(28, 28, 28, 0.98) 0%, rgba(38, 38, 38, 0.98) 100%);
    border: 1px solid #8a0303;
    border-radius: 6px;
    color: #e0d6c2;
    font-family: "El Messiri", "Arial", sans-serif;
    font-size: 0.85rem;
    box-shadow: 0 3px 12px rgba(138, 3, 3, 0.25), inset 0 0 8px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast-success {
    border-color: #27ae60;
    box-shadow: 0 3px 12px rgba(39, 174, 96, 0.25), inset 0 0 8px rgba(0, 0, 0, 0.35);
}

.toast-error {
    border-color: #e74c3c;
    box-shadow: 0 3px 12px rgba(231, 76, 60, 0.25), inset 0 0 8px rgba(0, 0, 0, 0.35);
}

.toast-warning {
    border-color: #f39c12;
    box-shadow: 0 3px 12px rgba(243, 156, 18, 0.25), inset 0 0 8px rgba(0, 0, 0, 0.35);
}

.toast-info {
    border-color: #3498db;
    box-shadow: 0 3px 12px rgba(52, 152, 219, 0.25), inset 0 0 8px rgba(0, 0, 0, 0.35);
}

.toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(138, 3, 3, 0.15);
}

.toast-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "El Messiri", "Arial", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e0d6c2;
}

.toast-icon {
    font-size: 0.95rem;
    width: 16px;
    text-align: center;
}

.toast-success .toast-icon {
    color: #27ae60;
}

.toast-error .toast-icon {
    color: #e74c3c;
}

.toast-warning .toast-icon {
    color: #f39c12;
}

.toast-info .toast-icon {
    color: #3498db;
}

.toast-close {
    background: none;
    border: none;
    color: #c8b090;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px;
    border-radius: 2px;
    transition: all 0.15s ease;
    line-height: 1;
}

.toast-close:hover {
    color: #e0d6c2;
    background: rgba(138, 3, 3, 0.15);
    transform: rotate(90deg);
}

.toast-body {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.toast-footer {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(138, 3, 3, 0.15);
}

.toast-btn {
    padding: 4px 10px;
    border: 1px solid rgba(138, 3, 3, 0.3);
    border-radius: 3px;
    background: linear-gradient(135deg, rgba(32, 32, 32, 0.9) 0%, rgba(42, 42, 42, 0.9) 100%);
    color: #e0d6c2;
    font-family: "El Messiri", "Arial", sans-serif;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.toast-btn:hover {
    background: linear-gradient(135deg, #8a0303 0%, #a50404 100%);
    transform: translateY(-1px);
    box-shadow: 0 1px 5px rgba(138, 3, 3, 0.25);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #8a0303, #ff0000);
    width: 100%;
    transform: scaleX(1);
    transform-origin: left;
    transition: transform 0.1s linear;
}

.toast-royal-crown {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 9px;
    background: linear-gradient(135deg, #c8b090 0%, #e0d6c2 100%);
    clip-path: polygon(0% 100%, 20% 0%, 30% 50%, 50% 0%, 70% 50%, 80% 0%, 100% 100%);
    z-index: 2;
}

.toast-decoration {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid #8a0303;
    border-radius: 50%;
    opacity: 0.3;
}

.toast-decoration-top-left {
    top: -5px;
    left: -5px;
}

.toast-decoration-top-right {
    top: -5px;
    right: -5px;
}

.toast-decoration-bottom-left {
    bottom: -5px;
    left: -5px;
}

.toast-decoration-bottom-right {
    bottom: -5px;
    right: -5px;
}
 
@keyframes toastShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-2px) rotate(-0.3deg); }
    75% { transform: translateX(2px) rotate(0.3deg); }
}

.toast-shake {
    animation: toastShake 0.3s ease-in-out;
}
 
@keyframes toastPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

.toast-pulse {
    animation: toastPulse 1.2s infinite ease-in-out;
}
 
@keyframes toastGlow {
    0%, 100% { box-shadow: 0 3px 12px rgba(138, 3, 3, 0.25); }
    50% { box-shadow: 0 3px 15px rgba(138, 3, 3, 0.3), 0 0 20px rgba(255, 0, 0, 0.15); }
}

.toast-glow {
    animation: toastGlow 1.8s infinite ease-in-out;
}

/* إزالة أي إشعارات قديمة */
.success-toast, .error-toast, .warning-toast, .info-toast,
.old-notification, .notification-old {
    display: none !important;
}
 
@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
        top: 15px;
    }
    
    .toast {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .toast-title {
        font-size: 0.85rem;
    }
    
    .toast-body {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .toast-container {
        right: 5px;
        left: 5px;
    }
    
    .toast {
        padding: 8px 12px;
    }
    
    .toast-title {
        font-size: 0.8rem;
        gap: 5px;
    }
    
    .toast-icon {
        font-size: 0.9rem;
    }
}