/* ========================================
   نظام Toast والإشعارات - تمشيها
   ======================================== */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 90%;
    width: 400px;
}

/* Toast Item */
.toast {
    background: white;
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    border-right: 4px solid #EA580C;
    font-family: 'Cairo', sans-serif;
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
}

/* Toast Types */
.toast.success { border-right-color: #22C55E; }
.toast.error { border-right-color: #EF4444; }
.toast.warning { border-right-color: #F59E0B; }
.toast.info { border-right-color: #3B82F6; }
.toast.purple { border-right-color: #8B5CF6; }
.toast.pink { border-right-color: #EC4899; }

/* Toast Icon */
.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: #FFF7ED;
}

.toast.success .toast-icon { background: #F0FDF4; }
.toast.error .toast-icon { background: #FEF2F2; }
.toast.warning .toast-icon { background: #FFFBEB; }
.toast.info .toast-icon { background: #EFF6FF; }
.toast.purple .toast-icon { background: #F5F3FF; }
.toast.pink .toast-icon { background: #FDF2F8; }

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    color: #1F2937;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: #6B7280;
    line-height: 1.4;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: #F3F4F6;
    color: #4B5563;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #EA580C;
    border-radius: 0 0 16px 16px;
    animation: toastProgress 4s linear forwards;
}

.toast.success .toast-progress { background: #22C55E; }
.toast.error .toast-progress { background: #EF4444; }
.toast.warning .toast-progress { background: #F59E0B; }
.toast.info .toast-progress { background: #3B82F6; }
.toast.purple .toast-progress { background: #8B5CF6; }
.toast.pink .toast-progress { background: #EC4899; }

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Notification Badge (Dynamic) */
.notification-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    background: #DC2626;
    color: white;
    font-size: 9px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: bold;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-badge.hidden {
    display: none;
}

/* Notification Bell Animation */
.bell-ring {
    animation: bellRing 0.6s ease-in-out;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-15deg); }
    60% { transform: rotate(10deg); }
    80% { transform: rotate(-10deg); }
}

/* Action Toast (with button) */
.toast-action {
    background: #EA580C;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.toast-action:hover {
    background: #C2410C;
    transform: scale(1.05);
}

/* Welcome Toast Special */
.toast.welcome {
    background: linear-gradient(135deg, #EA580C 0%, #F97316 100%);
    color: white;
    border: none;
}

.toast.welcome .toast-title,
.toast.welcome .toast-message {
    color: white;
}

.toast.welcome .toast-icon {
    background: rgba(255,255,255,0.2);
}

/* Responsive */
@media (max-width: 480px) {
    .toast-container {
        top: 70px;
        width: 95%;
    }
    
    .toast {
        padding: 12px 14px;
    }
}

.guide-bubble {
    position: absolute;
    z-index: 100000;
    width: min(320px, calc(100vw - 24px));
    background: #1f2937;
    color: #fff;
    border-radius: 16px;
    padding: 14px 38px 14px 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
    font-family: 'Cairo', Tahoma, Arial, sans-serif;
    direction: rtl;
    animation: guidePop 0.18s ease-out;
}

.guide-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.guide-bubble.below::after {
    top: -8px;
    bottom: auto;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent #1f2937 transparent;
}

.guide-title {
    font-size: 13px;
    font-weight: 900;
    color: #fed7aa;
    margin-bottom: 4px;
}

.guide-text {
    font-size: 12px;
    line-height: 1.8;
    color: #f9fafb;
}

.guide-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    line-height: 22px;
}

@keyframes guidePop {
    from { opacity: 0; transform: translateY(4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
