/* Notifications System Styles */
/* تنسيقات نظام الإشعارات */

/* Notifications Dropdown */
#notifications-dropdown {
    position: absolute;
    right: 0;
    margin-top: 0.5rem;
    width: 400px;
    max-width: calc(100vw - 2rem);
    background: #20212B;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    max-height: 600px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#notifications-dropdown:not(.hidden) {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Notifications Header */
.notifications-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(37, 99, 235, 0.1));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notifications-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.notifications-header button {
    font-size: 0.75rem;
    color: #a78bfa;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.notifications-header button:hover {
    background: rgba(167, 139, 250, 0.1);
    color: #c4b5fd;
}

/* Notifications List */
#notifications-list {
    overflow-y: auto;
    max-height: 500px;
    scrollbar-width: thin;
    scrollbar-color: #a78bfa #1a1b22;
}

#notifications-list::-webkit-scrollbar {
    width: 6px;
}

#notifications-list::-webkit-scrollbar-track {
    background: #1a1b22;
}

#notifications-list::-webkit-scrollbar-thumb {
    background: #a78bfa;
    border-radius: 10px;
}

#notifications-list::-webkit-scrollbar-thumb:hover {
    background: #c4b5fd;
}

/* Notification Item */
.notification-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.notification-item:hover {
    background: rgba(167, 139, 250, 0.05);
}

.notification-item:last-child {
    border-bottom: none;
}

/* Unread notification */
.notification-item.unread {
    background: rgba(59, 130, 246, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #a78bfa, #3b82f6);
}

/* Notification Icon */
.notification-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem;
    color: white;
}

.notification-icon.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.notification-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notification-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.notification-icon.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Notification Content */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-message {
    font-size: 0.8125rem;
    color: #9ca3af;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Unread Badge */
.unread-badge {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Notification Badge (Bell) */
#notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 9px;
    font-size: 0.625rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: badge-pop 0.3s ease-out;
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Empty State */
.notifications-empty {
    padding: 3rem 1.5rem;
    text-align: center;
}

.notifications-empty i {
    font-size: 3rem;
    color: #4b5563;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.notifications-empty p {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Loading State */
.notifications-loading {
    padding: 3rem 1.5rem;
    text-align: center;
}

.notifications-loading i {
    font-size: 2rem;
    color: #a78bfa;
    margin-bottom: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.notifications-loading p {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
    #notifications-dropdown {
        position: fixed !important;
        top: 60px !important;
        right: 0.5rem !important;
        left: 0.5rem !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
    }
    
    .notification-item {
        padding: 0.875rem 1rem;
    }
    
    .notification-icon {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
    
    .notification-content {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    .notification-title {
        font-size: 0.8125rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .notification-message {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notification Button Hover Effect */
#notifications-button {
    position: relative;
    transition: all 0.2s;
}

#notifications-button:hover {
    transform: scale(1.1);
}

#notifications-button:active {
    transform: scale(0.95);
}

/* Bell Animation on New Notification */
@keyframes ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: rotate(-10deg);
    }
    20%, 40%, 60%, 80% {
        transform: rotate(10deg);
    }
}

.notification-ring {
    animation: ring 0.5s ease-in-out;
}
