/**
 * منصة يونيميديا - نظام الإشعارات والتوست
 * Toast Notifications & Alert System
 */

/* ================================
   Toast Notifications Container
   ================================ */
.toast-container {
    position: fixed;
    top: 100px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

[dir="rtl"] .toast-container {
    left: auto;
    right: 20px;
}

/* ================================
   Toast Item
   ================================ */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px 20px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
    max-width: 100%;
}

[dir="rtl"] .toast {
    transform-origin: right center;
}

.toast.toast-hiding {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[dir="rtl"] .toast {
    animation-name: toastSlideInRTL;
}

@keyframes toastSlideInRTL {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* ================================
   Toast Icon
   ================================ */
.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* ================================
   Toast Content
   ================================ */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* ================================
   Toast Close Button
   ================================ */
.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* ================================
   Toast Progress Bar
   ================================ */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    animation: toastProgress 5s linear forwards;
}

.toast-success .toast-progress-bar {
    background: #10b981;
}

.toast-error .toast-progress-bar {
    background: #ef4444;
}

.toast-warning .toast-progress-bar {
    background: #f59e0b;
}

.toast-info .toast-progress-bar {
    background: #3b82f6;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* ================================
   Enhanced Dropdown Menus
   ================================ */
.dropdown-premium {
    position: relative;
    display: inline-block;
}

.dropdown-premium-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    padding: 8px;
    overflow: hidden;
}

[dir="rtl"] .dropdown-premium-menu {
    right: auto;
    left: 0;
}

.dropdown-premium.active .dropdown-premium-menu,
.dropdown-premium:hover .dropdown-premium-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-premium-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.dropdown-premium-header-title {
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
}

.dropdown-premium-header-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.dropdown-premium-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-premium-item:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15));
    color: white;
}

.dropdown-premium-item i {
    width: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
}

.dropdown-premium-item:hover i {
    color: #8b5cf6;
}

.dropdown-premium-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.dropdown-premium-item.danger {
    color: rgba(239, 68, 68, 0.9);
}

.dropdown-premium-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.dropdown-premium-item.danger i {
    color: rgba(239, 68, 68, 0.7);
}

/* ================================
   Notification Badge
   ================================ */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

[dir="rtl"] .notification-badge {
    right: auto;
    left: -5px;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Badge empty state */
.notification-badge:empty,
.notification-badge[data-count="0"] {
    display: none;
}

/* ================================
   Confirm Dialog
   ================================ */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    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: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.confirm-overlay.active .confirm-dialog {
    transform: scale(1) translateY(0);
}

.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: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.confirm-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.confirm-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.confirm-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.confirm-message {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 25px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.confirm-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.confirm-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.confirm-btn-confirm {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
}

.confirm-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}

.confirm-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.confirm-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.4);
}

/* ================================
   Mobile Responsive
   ================================ */
@media (max-width: 480px) {
    .toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    [dir="rtl"] .toast-container {
        right: 10px;
        left: 10px;
    }

    .toast {
        padding: 14px 16px;
    }

    .confirm-dialog {
        padding: 25px 20px;
    }

    .confirm-actions {
        flex-direction: column;
    }

    .confirm-btn {
        width: 100%;
    }
}