/**
 * Toast Notifications & Quick Feedback System
 * إشعارات منبثقة وردود فعل سريعة
 */

/* ================================
   Toast Container
   ================================ */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: 90%;
    pointer-events: none;
}

/* RTL Support */
[dir="rtl"] .toast-container {
    left: 50%;
    right: auto;
}

/* ================================
   Toast Item
   ================================ */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    animation: toastIn 0.3s ease forwards;
    pointer-events: all;
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.toast-message {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #374151;
}

/* Toast Types */
.toast.success .toast-icon {
    background: #dcfce7;
    color: #16a34a;
}

.toast.error .toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast.warning .toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.toast.info .toast-icon {
    background: #dbeafe;
    color: #2563eb;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
    border-radius: 0 0 12px 12px;
    animation: progressShrink 5s linear forwards;
}

@keyframes progressShrink {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* ================================
   Quick Action Buttons
   ================================ */
.quick-action-bar {
    position: fixed;
    bottom: 100px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

[dir="rtl"] .quick-action-bar {
    right: auto;
    left: 20px;
}

.quick-action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.quick-action-btn:hover {
    transform: scale(1.1);
}

.quick-action-btn.primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.quick-action-btn.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.quick-action-btn.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Tooltip for Quick Actions */
.quick-action-btn::before {
    content: attr(data-label);
    position: absolute;
    right: 70px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

[dir="rtl"] .quick-action-btn::before {
    right: auto;
    left: 70px;
}

.quick-action-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ================================
   Notification Bell Badge
   ================================ */
.notification-bell {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ================================
   Confirmation Dialog
   ================================ */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-overlay.active .confirm-dialog {
    transform: scale(1);
}

.confirm-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.confirm-icon.warning {
    background: #fef3c7;
    color: #d97706;
}

.confirm-icon.danger {
    background: #fee2e2;
    color: #dc2626;
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.confirm-message {
    color: #6b7280;
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.confirm-btn.cancel {
    background: #f3f4f6;
    color: #374151;
}

.confirm-btn.cancel:hover {
    background: #e5e7eb;
}

.confirm-btn.confirm {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.confirm-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

/* ================================
   Success Animation
   ================================ */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #10b981;
}

.success-checkmark .check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.success-checkmark .check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.success-checkmark .check-icon::before,
.success-checkmark .check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    background: #fff;
    transform: rotate(-45deg);
}

.success-checkmark .icon-line {
    height: 5px;
    background-color: #10b981;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.success-checkmark .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.success-checkmark .icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }

    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }

    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }

    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }

    100% {
        width: 25px;
        left: 14px;
        top: 46px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }

    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }

    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }

    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        max-width: 95%;
    }

    .quick-action-bar {
        bottom: 80px;
        right: 15px;
    }

    .quick-action-btn {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }

    .confirm-dialog {
        padding: 25px 20px;
    }
}