/* مؤشر حالة الاتصال */
.online-status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    position: relative;
    transition: all 0.3s ease;
}

/* متصل ونشط */
.online-status-indicator.online,
.online-status-indicator.active {
    background-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
    animation: pulse 2s infinite;
}

/* غير متصل */
.online-status-indicator.offline {
    background-color: #9E9E9E;
    box-shadow: 0 0 0 2px rgba(158, 158, 158, 0.2);
}

/* بعيد (Away) */
.online-status-indicator.away {
    background-color: #FFC107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

/* مشغول */
.online-status-indicator.busy {
    background-color: #F44336;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.3);
}

/* تأثير النبض للمتصلين */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
    }
}

/* عرض اسم المستخدم مع المؤشر */
.user-name {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* قائمة المستخدمين المتصلين */
.online-users-list {
    max-height: 400px;
    overflow-y: auto;
    direction: rtl;
}

.online-user-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
    cursor: pointer;
}

.online-user-item:hover {
    background-color: #f9fafb;
}

.online-user-item:last-child {
    border-bottom: none;
}

.online-user-item .user-avatar {
    position: relative;
    margin-left: 12px;
    flex-shrink: 0;
}

.online-user-item .user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.online-user-item .user-avatar .online-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    margin: 0;
}

.online-user-item .user-info {
    flex: 1;
    min-width: 0;
}

.online-user-item .user-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-user-item .user-status {
    font-size: 0.75rem;
    color: #6b7280;
}

/* عداد المستخدمين المتصلين */
.online-users-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background-color: #10b981;
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* لوحة المستخدمين المتصلين */
.online-users-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 16px;
}

.online-users-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.online-users-panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* مؤشر المستخدم الحالي في الهيدر */
.current-user-online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border: 2px solid white;
    border-radius: 50%;
    background-color: #4CAF50; /* اللون الأخضر الافتراضي */
}

/* حالات مختلفة للنقطة الخضراء للمستخدم الحالي */
.current-user-online-indicator.online {
    background-color: #4CAF50;
    animation: pulse 2s infinite;
}

.current-user-online-indicator.offline {
    background-color: #9E9E9E;
}

.current-user-online-indicator.away {
    background-color: #FFC107;
}

.current-user-online-indicator.busy {
    background-color: #F44336;
}

/* رسالة فارغة */
.online-users-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.online-users-empty svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: 0.5;
}

/* تنسيق شريط التمرير */
.online-users-list::-webkit-scrollbar {
    width: 6px;
}

.online-users-list::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.online-users-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.online-users-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 640px) {
    .online-user-item {
        padding: 8px;
    }
    
    .online-user-item .user-avatar img {
        width: 36px;
        height: 36px;
    }
    
    .online-users-panel {
        padding: 12px;
    }
} 